You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/12/13 21:25:17 UTC

[GitHub] [pinot] 61yao commented on a diff in pull request #9962: [multistage] add defensive scheduling, enable for tests

61yao commented on code in PR #9962:
URL: https://github.com/apache/pinot/pull/9962#discussion_r1047767657


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/executor/RoundRobinScheduler.java:
##########
@@ -58,12 +64,30 @@ public class RoundRobinScheduler implements OpChainScheduler {
   @VisibleForTesting
   final Set<MailboxIdentifier> _seenMail = new HashSet<>();
 
+  public RoundRobinScheduler() {
+    this(DEFAULT_RELEASE_TIMEOUT);
+  }
+
+  public RoundRobinScheduler(long releaseTimeout) {
+    this(releaseTimeout, System::currentTimeMillis);
+  }
+
+  public RoundRobinScheduler(long releaseTimeoutMs, Supplier<Long> ticker) {
+    _releaseTimeout = releaseTimeoutMs;
+    _ticker = ticker;
+  }
+
   @Override
   public void register(OpChain operatorChain, boolean isNew) {
     // the first time an operator chain is scheduled, it should
     // immediately be considered ready in case it does not need
     // read from any mailbox (e.g. with a LiteralValueOperator)
-    (isNew ? _ready : _available).add(operatorChain);
+    if (isNew) {
+      _ready.add(operatorChain);
+    } else {
+      long releaseTs = _releaseTimeout < 0 ? Long.MAX_VALUE : _ticker.get() + _releaseTimeout;

Review Comment:
   This should probably be tied with query deadline. since it is for debugging purpose, LG for now. 



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org