dcapwell commented on code in PR #65:
URL: https://github.com/apache/cassandra-accord/pull/65#discussion_r1309148731
##########
accord-core/src/main/java/accord/impl/InMemoryCommandStore.java:
##########
@@ -871,31 +903,41 @@ public static class Synchronized extends
InMemoryCommandStore
{
Runnable active = null;
final Queue<Runnable> queue = new ConcurrentLinkedQueue<>();
+ private final AtomicBoolean running = new AtomicBoolean(false);
public Synchronized(int id, NodeTimeService time, Agent agent,
DataStore store, ProgressLog.Factory progressLogFactory, EpochUpdateHolder
epochUpdateHolder)
{
super(id, time, agent, store, progressLogFactory,
epochUpdateHolder);
}
- private synchronized void maybeRun()
+ private void maybeRun()
{
- if (active != null)
+ if (!running.compareAndSet(false, true))
Review Comment:
this is not related to this patch but was from a different patch I had... I
added more messages tests that used this class and I hit a deadlock where one
store (S1) was trying to enqueue work to a different store (S2) and that store
was trying to enqueue work in the other store (S1)...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]