From 2db553aa14f6ced82781ba3fbf97737ba3988a7e Mon Sep 17 00:00:00 2001 From: Stephan Reiter Date: Wed, 25 Sep 2019 14:04:52 +0200 Subject: [PATCH] Reduce default SoftKillWaitSeconds from 2min to 5s --- core/src/main/java/hudson/util/ProcessTree.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index e8e48915c66f..6200aeba2ade 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -156,7 +156,13 @@ public final Iterator iterator() { */ 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()}.