Skip to content
Browse files
[JENKINS-27329] Less aggressive WorkspaceCleanupThread (#3444)
* JENKINS-27329 Less aggressive WorkspaceCleanupThread

I dare to claim that the default behaviour of WorkspaceCleanupThread is too aggressive => this little change is by no means perfect (or admittedly even far from perfect), but IMHO a saner or slightly more defensive default behaviour.

Mind that according to this "only" checks whether or not the last build of a job is in progress, while the JavaDoc says "Returns true if a build of this project is in progress." (cf.

* Fix compilation

* Dummy commit to trigger pipeline

Previous pipeline execution ( failed with one failing test that at first glance appears to be unrelated with my change(s) and looks like a flaky test?

* Add fine logging message
  • Loading branch information
reinholdfuereder authored and oleg-nenashev committed May 26, 2018
1 parent ccd6455 commit f258aff7a736a81306ecb7d3c56cacc9b3a09a68
Showing with 9 additions and 0 deletions.
  1. +9 −0 core/src/main/java/hudson/model/
@@ -139,6 +139,15 @@ private boolean shouldBeDeleted(@Nonnull TopLevelItem item, FilePath dir, @Nonnu

// TODO this may only check the last build in fact:
if (item instanceof Job<?,?>) {
Job<?,?> j = (Job<?,?>) item;
if (j.isBuilding()) {
LOGGER.log(Level.FINE, "Job {0} is building, so not deleting", item.getFullDisplayName());
return false;

LOGGER.log(Level.FINER, "Going to delete directory {0}", dir);
return true;

0 comments on commit f258aff

Please sign in to comment.