Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34722

Unbounded searches with BuildUtil.getDownstreamBuild

    XMLWordPrintable

Details

    Description

      BuildUtil.getDownstreamBuild does an unbounded search of build records, which is never acceptable due to Jenkins lazy-loading, and particular not in the context of an HTTP handler thread.

      It would be better is to use AbstractBuild.getDownstreamBuilds(AbstractProject), which is efficient, though it only works for project chains which are correctly configured with fingerprints.

      Example:

      "Handling GET /jenkins/org/job/Pipelines/job/org-build/view/Pipelines_View/ from 10.x.x.x : RequestHandlerThread[#2296] View/index.jelly" Id=126293 BLOCKED on hudson.model.RunMap@607d5beb owned by "Handling GET /jenkins/org/job/Pipelines/job/org-build/ from 10.x.x.x : RequestHandlerThread[#2297] View/index.jelly" Id=126471
          at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java)
          -  blocked on hudson.model.RunMap@607d5beb
          at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:448)
          at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:356)
          at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:332)
          at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:74)
          at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:63)
          at java.util.AbstractMap$2$1.next(AbstractMap.java:396)
          at au.com.centrumsystems.hudson.plugin.util.BuildUtil.getDownstreamBuild(BuildUtil.java:66)
      

      Attachments

        Issue Links

          Activity

            ganthore Mark Austin created issue -
            ganthore Mark Austin made changes -
            Field Original Value New Value
            Description BuildUtil.getDownstreamBuild does an unbounded search of build records, which is never acceptable due to Jenkins lazy-loading, and particular not in the context of an HTTP handler thread.

            It would be better is to use AbstractBuild.getDownstreamBuilds(AbstractProject), which is efficient, though it only works for project chains which are correctly configured with fingerprints.
            BuildUtil.getDownstreamBuild does an unbounded search of build records, which is never acceptable due to Jenkins lazy-loading, and particular not in the context of an HTTP handler thread.

            It would be better is to use AbstractBuild.getDownstreamBuilds(AbstractProject), which is efficient, though it only works for project chains which are correctly configured with fingerprints.

            Example:
            {code}
            "Handling GET /jenkins/org/job/Pipelines/job/org-build/view/Pipelines_View/ from 10.x.x.x : RequestHandlerThread[#2296] View/index.jelly" Id=126293 BLOCKED on hudson.model.RunMap@607d5beb owned by "Handling GET /jenkins/org/job/Pipelines/job/org-build/ from 10.x.x.x : RequestHandlerThread[#2297] View/index.jelly" Id=126471
                at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java)
                - blocked on hudson.model.RunMap@607d5beb
                at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:448)
                at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:356)
                at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:332)
                at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:74)
                at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:63)
                at java.util.AbstractMap$2$1.next(AbstractMap.java:396)
                at au.com.centrumsystems.hudson.plugin.util.BuildUtil.getDownstreamBuild(BuildUtil.java:66)
            {code}
            schristou Steven Christou made changes -
            Remote Link This issue links to "PR 100 (Web Link)" [ 14319 ]
            schristou Steven Christou made changes -
            Assignee Steven Christou [ schristou ]
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 170903 ] JNJira + In-Review [ 198976 ]

            People

              schristou Steven Christou
              ganthore Mark Austin
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: