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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 3b1f0d2c3b Fix session listener replication
3b1f0d2c3b is described below

commit 3b1f0d2c3bffc277406ed74912903c84449dd1f4
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 2 15:50:42 2026 +0100

    Fix session listener replication
---
 java/org/apache/catalina/ha/session/DeltaRequest.java | 9 ++++++---
 webapps/docs/changelog.xml                            | 5 +++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/ha/session/DeltaRequest.java 
b/java/org/apache/catalina/ha/session/DeltaRequest.java
index 818ca8d709..404baf5932 100644
--- a/java/org/apache/catalina/ha/session/DeltaRequest.java
+++ b/java/org/apache/catalina/ha/session/DeltaRequest.java
@@ -277,9 +277,12 @@ public class DeltaRequest implements Externalizable {
         } else {
             info = new AttributeInfo(type, action, name, value);
         }
-        // if we have already done something to this attribute, make sure
-        // we don't send multiple actions across the wire
-        if (!recordAllActions) {
+        /*
+         * If we have already done something to this attribute, make sure we 
don't send multiple actions across the
+         * wire. Listeners are a special case as they are stored (in 
StandardSession) as a List not a Map so two calls
+         * to addSessionListener(l) should add the same listener twice. 
Therefore always send all listener events.
+         */
+        if (!recordAllActions && type != TYPE_LISTENER) {
             Iterator<AttributeInfo> iterator = actions.iterator();
             while (iterator.hasNext()) {
                 AttributeInfo existing = iterator.next();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 16e369ad77..5376f73dd8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -242,6 +242,11 @@
         other nodes like attributes set later on rather than remaining local to
         the node that started the application. (remm)
       </fix>
+      <fix>
+        Fix an issue replicating <code>SessionListener</code> additions and
+        removals that meant some modification were not replicated leading to
+        inconsistent listener configurations across the cluster. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">


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

Reply via email to