walterddr commented on code in PR #10289:
URL: https://github.com/apache/pinot/pull/10289#discussion_r1110439255


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/executor/RoundRobinScheduler.java:
##########
@@ -79,128 +69,145 @@ public RoundRobinScheduler(long releaseTimeout) {
   public RoundRobinScheduler(long releaseTimeoutMs, Supplier<Long> ticker) {
     _releaseTimeout = releaseTimeoutMs;
     _ticker = ticker;
+    _availableOpChainReleaseService = 
Executors.newSingleThreadScheduledExecutor(r -> {
+      Thread t = new Thread(r);
+      t.setName(AVAILABLE_RELEASE_THREAD_NAME);
+      t.setDaemon(true);
+      return t;
+    });
+    if (releaseTimeoutMs > 0) {
+      _availableOpChainReleaseService.scheduleAtFixedRate(() -> {
+        for (Map.Entry<OpChainId, Long> entry : _available.entrySet()) {

Review Comment:
   isn't it possible that the available hashmap get's changed during this loop? 
do you need to lock the entire thing or keep an immutable copy of the available 
during entrance of this scheduled task?



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