yifan-c commented on code in PR #192:
URL: https://github.com/apache/cassandra-sidecar/pull/192#discussion_r1956517128
##########
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:
It still wants to grab the `future` of the active run, so that unschedule
can chain "task.close()" after the run has finished, to avoid any interruption
to the active run.
--
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]