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 03c16b4c50e77eb835ef89f0b9cd23bdd2234d6a Author: opencode <[email protected]> AuthorDate: Sun Oct 11 10:34:59 2026 +0200 Guard the sender recovery trigger against a concurrent stop The multicast sender triggered a service recovery once it had hit recoveryCounter consecutive send failures, without re-checking the doRunSender flag that ReceiverThread consults before the same action. Since the recovery thread always recreates the socket and the receiver and sender threads, the last send failure of a closing socket could schedule a recovery that brought the membership back after McastService.stop() had already discarded the implementation. Nothing then held a reference to stop that revived implementation, so it kept pinging with the old unique id, leaving peers unable to expire the departed member, and leaked the socket and two threads. The counter increment and the recovery call now happen only while doRunSender is still set, exactly as in the receiver. Recovery on a running service is unchanged. --- java/org/apache/catalina/tribes/membership/McastServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java index 1eec1a731c..d5c538026f 100644 --- a/java/org/apache/catalina/tribes/membership/McastServiceImpl.java +++ b/java/org/apache/catalina/tribes/membership/McastServiceImpl.java @@ -697,9 +697,11 @@ public class McastServiceImpl extends MembershipProviderBase { } else { log.debug(sm.getString("mcastServiceImpl.send.failed"), e); } - if ((++errorCounter) >= recoveryCounter) { - errorCounter = 0; - RecoveryThread.recover(McastServiceImpl.this); + if (doRunSender) { + if ((++errorCounter) >= recoveryCounter) { + errorCounter = 0; + RecoveryThread.recover(McastServiceImpl.this); + } } } try { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
