From 4725e758942ad06c066963d3404a90c42ecbe476 Mon Sep 17 00:00:00 2001 From: lihongyi <642826683@qq.com> Date: Sun, 2 Aug 2026 11:31:37 +0800 Subject: [PATCH] Make default value of interruptThreadThreshold explicit The interruptThreadThreshold field relied on the Java default of 0 which disables thread interruption. The Javadoc and valve documentation both state the default is -1. Make the default explicit (-1) so the code matches the documented behaviour. --- java/org/apache/catalina/valves/StuckThreadDetectionValve.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java index 9134fda5a834..9302697de5ba 100644 --- a/java/org/apache/catalina/valves/StuckThreadDetectionValve.java +++ b/java/org/apache/catalina/valves/StuckThreadDetectionValve.java @@ -71,7 +71,7 @@ public class StuckThreadDetectionValve extends ValveBase { /** * In seconds. Default is -1 to disable interruption. */ - private int interruptThreadThreshold; + private int interruptThreadThreshold = -1; /** * The only references we keep to actual running Thread objects are in this Map (which is automatically cleaned in