yashmayya commented on code in PR #15201:
URL: https://github.com/apache/pinot/pull/15201#discussion_r1981749262


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java:
##########
@@ -146,7 +146,13 @@ public QueryResult submitAndReduce(RequestContext context, 
DispatchableSubPlan d
     Set<QueryServerInstance> servers = new HashSet<>();
     try {
       submit(requestId, dispatchableSubPlan, timeoutMs, servers, queryOptions);
-      return runReducer(requestId, dispatchableSubPlan, timeoutMs, 
queryOptions, _mailboxService);
+      try {
+        return runReducer(requestId, dispatchableSubPlan, timeoutMs, 
queryOptions, _mailboxService);
+      } finally {
+        if (isQueryCancellationEnabled()) {
+          _serversByQuery.remove(requestId);
+        }
+      }

Review Comment:
   I'm not sure I follow. Won't that be too soon to remove it? Submit is only 
submitting the stage plans to the servers. The reducer is where we're waiting 
for the result blocks from the final stage. Queries should be cancellable until 
they finish executing (either successfully or unsuccessfully), so we can't 
really remove state from `_serversByQuery` in `submit` right?



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