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

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

commit 3ff5ca9b1fcbb5a7890de77f202df20001170f0b
Author: opencode <[email protected]>
AuthorDate: Sun Oct 11 14:18:31 2026 +0200

    Send broadcasts and pings to the checked member snapshot
    
    The broadcast snapshots the channel members and returns early when the
    snapshot is empty, but the non RPC branch then sent with a fresh read
    of the channel members. A membership change between the check and the
    send moved the message to another member set than the checked one, or
    lost it entirely when the fresh read came back empty, which silently
    dropped the stop notification of the breakdown when the last members
    had just left. The ping had the same double read for its RPC send.
    
    The send now uses the members that were checked to be non empty.
---
 java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java 
b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
index 51dd9981f9..29e0c69147 100644
--- a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
+++ b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
@@ -322,10 +322,11 @@ public abstract class AbstractReplicatedMap<K, V>
     protected void ping(long timeout) throws ChannelException {
         MapMessage msg = new MapMessage(this.mapContextName, 
MapMessage.MSG_PING, false, null, null, null,
                 channel.getLocalMember(false), null);
-        if (channel.getMembers().length > 0) {
+        Member[] channelMembers = channel.getMembers();
+        if (channelMembers.length > 0) {
             try {
                 // send a ping, wait for all nodes to reply
-                Response[] resp = rpcChannel.send(channel.getMembers(), msg, 
RpcChannel.ALL_REPLY, (channelSendOptions),
+                Response[] resp = rpcChannel.send(channelMembers, msg, 
RpcChannel.ALL_REPLY, (channelSendOptions),
                         (int) accessTimeout);
                 for (Response response : resp) {
                     MapMessage mapMsg = (MapMessage) response.getMessage();
@@ -429,7 +430,7 @@ public abstract class AbstractReplicatedMap<K, V>
                 
log.warn(sm.getString("abstractReplicatedMap.broadcast.noReplies"));
             }
         } else {
-            channel.send(channel.getMembers(), msg, channelSendOptions);
+            channel.send(members, msg, channelSendOptions);
         }
     }
 


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

Reply via email to