提交 f258aff7 编写于 作者: R Reinhold Füreder 提交者: Oleg Nenashev

[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 https://github.com/jenkinsci/jenkins/blob/9e64bcdcb4a2cf12d59dfa334e09ffb448d361e9/core/src/main/java/hudson/model/Job.java#L301 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. http://javadoc.jenkins-ci.org/hudson/model/Job.html#isBuilding--)

* Fix compilation

* Dummy commit to trigger pipeline

Previous pipeline execution (https://ci.jenkins.io/blue/organizations/jenkins/Core%2Fjenkins/detail/PR-3444/2/tests) 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
上级 ccd6455e
......@@ -139,6 +139,15 @@ public class WorkspaceCleanupThread extends AsyncPeriodicWork {
}
}
// 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册