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

LogRotator stops cleaning, if a build directory has been deleted externally

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Any (is a core Jenkins behaviour)
    • jenkins-2.196

      The deletion of a build/run in Jenkins is handled by the delete() method.

      It throws an exception, when the build directory on disk has already been removed and stops deleting the build.

      Unfortunately, the hudson.tasks.LogRotator.perform(Job<?, ?>) method does not check for this exception and will STOP cleaning up, once even just one build throws that exception.

      This behaviour can be fixed in the following ways (a pull-request will be uploaded shortly):

      1. The Run.delete() method must still unlink the job, even if the build directory has been removed externally.
      2. The log output of Run.delete() must be made less verbose (it prints the ENTIRE folder content by default, into the job that is doing the cleanup)
      3. The LogRotator.perform() method must handle the exceptions being thrown by delete() gracefully.

       

          [JENKINS-58779] LogRotator stops cleaning, if a build directory has been deleted externally

          Martin Schröder created issue -
          Josh Soref made changes -
          Remote Link New: This issue links to "PR#4138 (Web Link)" [ 23709 ]
          Josh Soref made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Josh Soref made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Josh Soref made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]
          Josh Soref made changes -
          Description Original: The deletion of a build/run in Jenkins is handled by the delete() method.


          It throws an exception, when the build directory on disk has already beenremoved and stops deleting the build.


          Unfortunately, the hudson.tasks.LogRotator.perform(Job<?, ?>) method does not check for this exception and will STOP cleaning up, once even just one build throws that exception.


          This behaviour can be fixed in the following ways (a pull-request will be uploaded shortly):
           # The Run.delete() method must still unlink the job, even if the build directory has been removed externally.
           # The log output of Run.delete() must be made less verbose (it prints the ENTIRE folder content by default, into the job that is doing the cleanup)
           # The LogRotator.perform() method must handle the exceptions being thrown by delete() gracefully.

           
          New: The deletion of a build/run in Jenkins is handled by the {{delete()}} method.

          It throws an exception, when the build directory on disk has already been removed and stops deleting the build.

          Unfortunately, the {{hudson.tasks.LogRotator.perform(Job<?, ?>)}} method does not check for this exception and will _STOP_ cleaning up, once even just one build throws that exception.

          This behaviour can be fixed in the following ways (a pull-request will be uploaded shortly):
           # The {{Run.delete()}} method must still unlink the job, even if the build directory has been removed externally.
           # The log output of {{Run.delete()}} must be made less verbose (it prints the ENTIRE folder content by default, into the job that is doing the cleanup)
           # The {{LogRotator.perform()}} method must handle the exceptions being thrown by {{delete()}} gracefully.

           
          Daniel Beck made changes -
          Released As New: jenkins-2.196
          Status Original: Fixed but Unreleased [ 10203 ] New: Closed [ 6 ]
          Jesse Glick made changes -
          Link New: This issue causes JENKINS-60716 [ JENKINS-60716 ]

            mhschroe Martin Schröder
            mhschroe Martin Schröder
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: