ankitsultana commented on code in PR #10289:
URL: https://github.com/apache/pinot/pull/10289#discussion_r1110439394
##########
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:
note: Iterating over a map and deleting is error-prone even with concurrent
hash-map. I'll split this into different loops.
--
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]