This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 6bc6ca99a556dade75a47309c41111717c53fb56
Author: opencode <[email protected]>
AuthorDate: Wed Sep 30 22:57:46 2026 +0200

    Remove completed file factories by instance in FarmWarDeployer to avoid 
evicting a freshly created factory for a new transfer of the same WAR
---
 java/org/apache/catalina/ha/deploy/FarmWarDeployer.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java 
b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
index 1c9b9a4d60..27f27835a8 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -254,7 +254,7 @@ public class FarmWarDeployer extends ClusterListener 
implements ClusterDeployer,
                     } catch (Exception e) {
                         
log.error(sm.getString("farmWarDeployer.fileMessageError"), e);
                     } finally {
-                        removeFactory(fmsg);
+                        removeFactory(fmsg, factory);
                     }
                 }
             } else if (msg instanceof UndeployMessage) {
@@ -309,10 +309,13 @@ public class FarmWarDeployer extends ClusterListener 
implements ClusterDeployer,
     /**
      * Remove file (war) from messages
      *
-     * @param msg The file
+     * @param msg     The file
+     * @param factory The factory for which the transfer completed
      */
-    public void removeFactory(FileMessage msg) {
-        fileFactories.remove(msg.getFileName());
+    public void removeFactory(FileMessage msg, FileMessageFactory factory) {
+        // Remove with the factory instance to avoid evicting a newer factory
+        // created for a new transfer of the same file
+        fileFactories.remove(msg.getFileName(), factory);
     }
 
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to