This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 16e4e9ea66 Handle spurious wake-ups during sending of messages by RpcChannel 16e4e9ea66 is described below commit 16e4e9ea6642646f2072a935561bc66fb9802f8a Author: Mark Thomas <ma...@apache.org> AuthorDate: Sat Aug 30 17:04:43 2025 +0100 Handle spurious wake-ups during sending of messages by RpcChannel --- java/org/apache/catalina/tribes/group/RpcChannel.java | 6 +++++- res/spotbugs/filter-false-positives.xml | 5 ----- webapps/docs/changelog.xml | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/tribes/group/RpcChannel.java b/java/org/apache/catalina/tribes/group/RpcChannel.java index 13475211d5..c26cff473c 100644 --- a/java/org/apache/catalina/tribes/group/RpcChannel.java +++ b/java/org/apache/catalina/tribes/group/RpcChannel.java @@ -100,7 +100,11 @@ public class RpcChannel implements ChannelListener { RpcMessage rmsg = new RpcMessage(rpcId, key.id, message); channel.send(destination, rmsg, sendOptions); if (rpcOptions != NO_REPLY) { - collector.wait(timeout); + long timeoutExpiry = System.nanoTime() + timeout * 1_000_000; + while (collector.isComplete() && timeout > 0) { + collector.wait(timeout); + timeout = (timeoutExpiry - System.nanoTime()) / 1_000_000; + } } } } catch (InterruptedException ix) { diff --git a/res/spotbugs/filter-false-positives.xml b/res/spotbugs/filter-false-positives.xml index aa5914ef2f..8186cbad9e 100644 --- a/res/spotbugs/filter-false-positives.xml +++ b/res/spotbugs/filter-false-positives.xml @@ -658,11 +658,6 @@ <Field name="utilityExecutor" /> <Bug pattern="IS2_INCONSISTENT_SYNC" /> </Match> - <Match> - <Class name="org.apache.catalina.tribes.group.RpcChannel"/> - <Method name="send"/> - <Bug pattern="WA_NOT_IN_LOOP"/> - </Match> <Match> <!-- Class lock is not an instance lock --> <Class name="org.apache.catalina.tribes.io.BufferPool" /> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index c3b3176c57..7dae8f8af6 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -145,6 +145,10 @@ Handle spurious wake-ups during leader election for <code>NonBlockingCoordinator</code>. (markt) </fix> + <fix> + Handle spurious wake-ups during sending of messages by + <code>RpcChannel</code>. (markt) + </fix> </changelog> </subsection> <subsection name = "Other"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org