This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 5608c440d4c18c0a97dfd6bfea14948a1a7d2655 Author: opencode <[email protected]> AuthorDate: Wed Sep 30 22:56:19 2026 +0200 Use a concurrent map for WarWatcher.currentStatus since clear() may run on the stop thread while check() iterates the map on the container background thread --- java/org/apache/catalina/ha/deploy/WarWatcher.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/ha/deploy/WarWatcher.java b/java/org/apache/catalina/ha/deploy/WarWatcher.java index 5f465afa98..6f2ca4bc2a 100644 --- a/java/org/apache/catalina/ha/deploy/WarWatcher.java +++ b/java/org/apache/catalina/ha/deploy/WarWatcher.java @@ -17,10 +17,10 @@ package org.apache.catalina.ha.deploy; import java.io.File; -import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -48,9 +48,11 @@ public class WarWatcher { protected final FileChangeListener listener; /** - * Currently deployed files + * Currently deployed files. A concurrent map is used since clear() may be + * called on the stop thread while check() iterates on the container + * background thread. */ - protected final Map<String,WarInfo> currentStatus = new HashMap<>(); + protected final Map<String,WarInfo> currentStatus = new ConcurrentHashMap<>(); /*--Constructor---------------------------------------------*/ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
