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

Deleting an external run does not immediately remove it from build list

    XMLWordPrintable

Details

    Description

      ViewJob.removeRun was implemented to just mark the build list (e.g. for an external monitor job) as "dirty", so that the next time the build list was requested, a reload task would be scheduled, and the next time after that the build would actually disappear. But if you configured the job to use LogRotator then each time that ran, Run.delete after deleting a build directory would ask to remove the build from the list, but the next rotation would still see this ghost build in the list and try to delete it again, which would of course fail with

      ... hudson.model.Run execute
      SEVERE: Failed to rotate log
      java.io.IOException: .../jobs/.../builds/2013-... is in use
      	at hudson.model.Run.delete(Run.java:1264)
      	at hudson.tasks.LogRotator.perform(LogRotator.java:132)
      	at hudson.model.Job.logRotate(Job.java:337)
      	at hudson.model.Run.execute(Run.java:1525)
      	at hudson.model.ExternalRun.acceptRemoteSubmission(ExternalRun.java:104)
      	at hudson.model.ExternalJob.doPostBuildResult(ExternalJob.java:102)
      

      For a frequently run task, these warnings could fill up the log, though it seems otherwise harmless since all the builds do eventually get deleted.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/model/ViewJob.java
            test/src/test/java/hudson/model/ViewJobTest.java
            http://jenkins-ci.org/commit/jenkins/bf444887ac16cc802695827da0a0f30949aa0f1f
            Log:
            [FIXED JENKINS-19377] ViewJob.removeRun must take effect synchronously or LogRotator gets confused.

            Compare: https://github.com/jenkinsci/jenkins/compare/d19a70acf472...bf444887ac16

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/ViewJob.java test/src/test/java/hudson/model/ViewJobTest.java http://jenkins-ci.org/commit/jenkins/bf444887ac16cc802695827da0a0f30949aa0f1f Log: [FIXED JENKINS-19377] ViewJob.removeRun must take effect synchronously or LogRotator gets confused. Compare: https://github.com/jenkinsci/jenkins/compare/d19a70acf472...bf444887ac16
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2839
            [FIXED JENKINS-19377] ViewJob.removeRun must take effect synchronously or LogRotator gets confused. (Revision bf444887ac16cc802695827da0a0f30949aa0f1f)

            Result = SUCCESS
            Jesse Glick : bf444887ac16cc802695827da0a0f30949aa0f1f
            Files :

            • core/src/main/java/hudson/model/ViewJob.java
            • changelog.html
            • test/src/test/java/hudson/model/ViewJobTest.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2839 [FIXED JENKINS-19377] ViewJob.removeRun must take effect synchronously or LogRotator gets confused. (Revision bf444887ac16cc802695827da0a0f30949aa0f1f) Result = SUCCESS Jesse Glick : bf444887ac16cc802695827da0a0f30949aa0f1f Files : core/src/main/java/hudson/model/ViewJob.java changelog.html test/src/test/java/hudson/model/ViewJobTest.java

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/model/ExternalJob.java
            http://jenkins-ci.org/commit/external-monitor-job-plugin/4e25b19f1db484b1c82f4ef6fd811b2c97cfcef4
            Log:
            JENKINS-19377 Work around in plugin for the short term.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/model/ExternalJob.java http://jenkins-ci.org/commit/external-monitor-job-plugin/4e25b19f1db484b1c82f4ef6fd811b2c97cfcef4 Log: JENKINS-19377 Work around in plugin for the short term.

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/hudson/model/ExternalJob.java
            http://jenkins-ci.org/commit/external-monitor-job-plugin/0a19f88596b9583b6e5395b2dbd4862c753430c0
            Log:
            JENKINS-19377 Workaround can be removed when using newer parent POM.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/hudson/model/ExternalJob.java http://jenkins-ci.org/commit/external-monitor-job-plugin/0a19f88596b9583b6e5395b2dbd4862c753430c0 Log: JENKINS-19377 Workaround can be removed when using newer parent POM.

            People

              jglick Jesse Glick
              jglick Jesse Glick
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: