JeetKunDoug commented on code in PR #192:
URL: https://github.com/apache/cassandra-sidecar/pull/192#discussion_r1956407741


##########
server/src/main/java/org/apache/cassandra/sidecar/tasks/PeriodicTaskExecutor.java:
##########
@@ -130,22 +147,33 @@ private void schedule(PeriodicTaskKey key, long 
priorExecDurationMillis, long de
      */
     private void executeAndScheduleNext(PeriodicTaskKey key, long execCount)
     {
+        Promise<Void> runPromise = Promise.promise();
+        if (activeRuns.computeIfAbsent(key, k -> runPromise.future()) != 
runPromise)

Review Comment:
   `activeRuns` no longer has any use for the _value_ of it's entries and can 
be converted to a `ConcurrentHashSet`, which simplifies this and `unschedule` 
quite a bit.



-- 
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]

Reply via email to