diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index d3c251205814eac40c18b39cec75e3ec83de4c39..e09f2e9c79631f121383e2ce0267043526c161fd 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -156,7 +156,13 @@ public abstract class ProcessTree implements Iterable, IProcessTree, */ public abstract void killAll(Map modelEnvVars) throws InterruptedException; - private final long softKillWaitSeconds = Integer.getInteger("SoftKillWaitSeconds", 2 * 60); // by default processes get at most 2 minutes to respond to SIGTERM (JENKINS-17116) + /** + * The time to wait between sending Ctrl+C and killing the process. (JENKINS-17116) + * + * The default is 5 seconds. Careful! There are other timers in the system that may + * interfere with this value here, e.g. in org.jenkinsci.plugins.workflow.cps.CpsThread.stop + */ + private final long softKillWaitSeconds = Integer.getInteger("SoftKillWaitSeconds", 5); /** * Convenience method that does {@link #killAll(Map)} and {@link OSProcess#killRecursively()}.