This is an automated email from the ASF dual-hosted git repository. ifesdjeen pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new 2924762fa1 LocalLog: Cancel signal when unused 2924762fa1 is described below commit 2924762fa1c29c3658507225e9e5e00853ec58e6 Author: Alex Petrov <oleksandr.pet...@gmail.com> AuthorDate: Tue Jan 30 11:29:09 2024 +0100 LocalLog: Cancel signal when unused Patch by Alex Petrov; reviewed by Marcus Eriksson and Sam Tunnicliffe for CASSANDRA-19353. --- src/java/org/apache/cassandra/tcm/log/LocalLog.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/cassandra/tcm/log/LocalLog.java b/src/java/org/apache/cassandra/tcm/log/LocalLog.java index bb878f5b12..cf7e383877 100644 --- a/src/java/org/apache/cassandra/tcm/log/LocalLog.java +++ b/src/java/org/apache/cassandra/tcm/log/LocalLog.java @@ -750,20 +750,24 @@ public abstract class LocalLog implements Closeable public void run(Interruptible.State state) throws InterruptedException { + WaitQueue.Signal signal = null; try { if (state != Interruptible.State.SHUTTING_DOWN) { Condition condition = subscriber.getAndSet(null); // Grab a ticket ahead of time, so that we can't get into race with the exit from process pending - WaitQueue.Signal signal = logNotifier.register(); + signal = logNotifier.register(); processPendingInternal(); if (condition != null) condition.signalAll(); // if no new threads have subscribed since we started running, await // otherwise, run again to process whatever work they may be waiting on if (subscriber.get() == null) + { signal.await(); + signal = null; + } } } catch (StopProcessingException t) @@ -780,6 +784,12 @@ public abstract class LocalLog implements Closeable // TODO handle properly logger.warn("Error in log follower", t); } + finally + { + // If signal was not consumed for some reason, cancel it + if (signal != null) + signal.cancel(); + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org