This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new bea30190de Fix session listener replication
bea30190de is described below
commit bea30190de240e64da9c19c4ce6e9d478f799af1
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 80f3491339..c7d657f158 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 7512f6d2b0..2e12779aae 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -452,6 +452,11 @@
the last associated session expires, even when the sessions expire on
different cluster nodes. (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="WebSocket">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]