Skip to content
Commit 89e25fce authored by Martin Schröder's avatar Martin Schröder Committed by Oleg Nenashev
Browse files

[JENKINS-58779] LogRotator stops, if build was deleted externally (#4138)



* [JENKINS-58779] LogRotator stops cleaning, if build was deleted externally

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 is fixed in the following ways in this change:

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.

Signed-off-by: default avatarMartin H Schroeder <martin.h.schroeder@intel.com>

* Small change to copyright header (removed blank line)

n/t

Signed-off-by: default avatarMartin H Schroeder <martin.h.schroeder@intel.com>

* Incorporated changes proposed by Oleg Nenashev

 - Usage of Util.fileToPath
 - Addition of @since headers to public API methods

Signed-off-by: default avatarMartin H Schroeder <martin.h.schroeder@intel.com>

* Added fixes for comments raised by Oleg Nenashev and Jeff Thompson

This adds a collective IOException raised for all sub-exceptions
encountered during the cleanup process.

Signed-off-by: default avatarMartin H Schroeder <martin.h.schroeder@intel.com>
parent 0d63e6a8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment