• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • JDK 1.7.0_25-b17 on Windows 2008 R2

      I noticed API calls (such as /job/doStuff/17/api/xml) failing "randomly" with HTTP 404. The thing is, you then open a browser to /job/doStuff and API calls would start working again. The same with job details, such as /job/doStuff/17/console. It would only happen to some jobs and not others, but not always the same jobs.

      Attaching a debugger to the running instance where this happened, I eventually was able to trace the defect to the search() method of the AbstractLazyLoadRunMap class, where it was able to obtain a "ceiling" entry that had a BuildReference with a null referent, which then hit all the right conditions for the method to return null even though the requested build number indeed existed. A SoftReference helps explain why this would occur "randomly" and then suddenly start working again after visiting the job's page, which would [re-]load all the builds.

      From what I can tell, this corner case has been missing since commit cf85b72

          [JENKINS-19418] Random HTTP 404 when viewing build details

          Olivier Dagenais created issue -

          Pull request #928 was submitted to merge my FixRandomHttp404 branch into jenkinsci:master.

          Olivier Dagenais added a comment - Pull request #928 was submitted to merge my FixRandomHttp404 branch into jenkinsci:master.
          Daniel Beck made changes -
          Labels Original: lazy-loading New: lazy-loading lts-candidate

          Daniel Beck added a comment - - edited

          I'm experiencing a similar problem on 1.509.2 with Copy Artifact failing to find specified builds. Browsing to the artifact source job/build fixes it for a while. Looks like it's the same issue, and it's not limited to use of the API.

          Daniel Beck added a comment - - edited I'm experiencing a similar problem on 1.509.2 with Copy Artifact failing to find specified builds. Browsing to the artifact source job/build fixes it for a while. Looks like it's the same issue, and it's not limited to use of the API.
          Jesse Glick made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
          core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java
          core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java
          http://jenkins-ci.org/commit/jenkins/3f3e05fa4a43272a0f8bd4685d4bd5faf9a683e8
          Log:
          Merge pull request #928 from olivierdagenais/FixRandomHttp404

          [FIXED JENKINS-19418] Fix random HTTP 404 when viewing build details

          Compare: https://github.com/jenkinsci/jenkins/compare/3454c9ec5065...3f3e05fa4a43

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java http://jenkins-ci.org/commit/jenkins/3f3e05fa4a43272a0f8bd4685d4bd5faf9a683e8 Log: Merge pull request #928 from olivierdagenais/FixRandomHttp404 [FIXED JENKINS-19418] Fix random HTTP 404 when viewing build details Compare: https://github.com/jenkinsci/jenkins/compare/3454c9ec5065...3f3e05fa4a43
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/06ccff707c24bb4401e8faaeaf0b7710ccf2f299
          Log:
          JENKINS-19418 Noting.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html http://jenkins-ci.org/commit/jenkins/06ccff707c24bb4401e8faaeaf0b7710ccf2f299 Log: JENKINS-19418 Noting.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2871
          JENKINS-19418 Noting. (Revision 06ccff707c24bb4401e8faaeaf0b7710ccf2f299)

          Result = SUCCESS
          Jesse Glick : 06ccff707c24bb4401e8faaeaf0b7710ccf2f299
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #2871 JENKINS-19418 Noting. (Revision 06ccff707c24bb4401e8faaeaf0b7710ccf2f299) Result = SUCCESS Jesse Glick : 06ccff707c24bb4401e8faaeaf0b7710ccf2f299 Files : changelog.html

          Code changed in jenkins
          User: Olivier Dagenais
          Path:
          core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
          core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java
          core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java
          http://jenkins-ci.org/commit/jenkins/b6dfb7ac90b4b5b0dd46b88244111cd2ec654801
          Log:
          JENKINS-19418 Fix random HTTP 404 when viewing build details

          Added a unit test (and supporting localExpiredBuilder) to expose a
          defect in the search() method of AbstractLazyLoadRunMap whereby the
          index contained an entry for the requested build number, but the
          BuildReference's referent was null.
          Fixed the search() method to handle this rare[ish] corner case.

          (cherry picked from commit 7c9aab3831e3df9f30585473e265efa8e2519537)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Dagenais Path: core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java core/src/test/java/jenkins/model/lazy/FakeMapBuilder.java http://jenkins-ci.org/commit/jenkins/b6dfb7ac90b4b5b0dd46b88244111cd2ec654801 Log: JENKINS-19418 Fix random HTTP 404 when viewing build details Added a unit test (and supporting localExpiredBuilder) to expose a defect in the search() method of AbstractLazyLoadRunMap whereby the index contained an entry for the requested build number, but the BuildReference's referent was null. Fixed the search() method to handle this rare [ish] corner case. (cherry picked from commit 7c9aab3831e3df9f30585473e265efa8e2519537)

            oli_at_jsi Olivier Dagenais
            oli_at_jsi Olivier Dagenais
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: