• 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

          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 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.

          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

          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)

          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
          http://jenkins-ci.org/commit/jenkins/33ad058fae24a5e3ea7498c29adf3af4f99b250e
          Log:
          JENKINS-19418 Minor formatting fixes.

          (cherry picked from commit d12b16c66b6cb2e382321f7bafb653c027931b1a)

          Compare: https://github.com/jenkinsci/jenkins/compare/b358d71ce0f0...33ad058fae24

          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 http://jenkins-ci.org/commit/jenkins/33ad058fae24a5e3ea7498c29adf3af4f99b250e Log: JENKINS-19418 Minor formatting fixes. (cherry picked from commit d12b16c66b6cb2e382321f7bafb653c027931b1a) Compare: https://github.com/jenkinsci/jenkins/compare/b358d71ce0f0...33ad058fae24

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          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/FakeMap.java
          http://jenkins-ci.org/commit/jenkins/b6b7bfd27c9b5551fde04416ee9b7b5faf16ad99
          Log:
          [FIXED JENKINS-22681] Fix of JENKINS-19418 should have used getById, not load, to avoid reloading the last build gratuitously.

          Compare: https://github.com/jenkinsci/jenkins/compare/e12e40adc6c2...b6b7bfd27c9b

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html 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/FakeMap.java http://jenkins-ci.org/commit/jenkins/b6b7bfd27c9b5551fde04416ee9b7b5faf16ad99 Log: [FIXED JENKINS-22681] Fix of JENKINS-19418 should have used getById, not load, to avoid reloading the last build gratuitously. Compare: https://github.com/jenkinsci/jenkins/compare/e12e40adc6c2...b6b7bfd27c9b

          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/FakeMap.java
          http://jenkins-ci.org/commit/jenkins/701045e6a27bb93ba739b111505d01c238ad455e
          Log:
          [FIXED JENKINS-22681] Fix of JENKINS-19418 should have used getById, not load, to avoid reloading the last build gratuitously.
          (cherry picked from commit b6b7bfd27c9b5551fde04416ee9b7b5faf16ad99)

          Conflicts:
          changelog.html

          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/FakeMap.java http://jenkins-ci.org/commit/jenkins/701045e6a27bb93ba739b111505d01c238ad455e Log: [FIXED JENKINS-22681] Fix of JENKINS-19418 should have used getById, not load, to avoid reloading the last build gratuitously. (cherry picked from commit b6b7bfd27c9b5551fde04416ee9b7b5faf16ad99) Conflicts: changelog.html

            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: