FrankChen021 commented on code in PR #20313:
URL: https://github.com/apache/druid/pull/20313#discussion_r4015537480


##########
multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartWorkerClientImpl.java:
##########
@@ -127,6 +138,13 @@ public void closeClient(final String workerIdString)
   public void close()
   {
     synchronized (clientMap) {
+      closed = true;
+
+      // Cancel requests before closing locators so in-flight requests do not 
continue retrying.
+      final List<ListenableFuture<?>> requests = new 
ArrayList<>(activeRequests);
+      activeRequests.clear();
+      requests.forEach(request -> request.cancel(true));

Review Comment:
   I rechecked all 8 changed files and the current head. This finding is 
resolved by 5853dc8: ControllerImpl registers workerManager.stop(true) before 
execution, while the worker client is registered earlier, so Closer invokes the 
manager stop before closing the worker client. The manager’s STOPPED path now 
also waits for the in-progress stop, preventing close from canceling the /stop 
futures before the acknowledgement wait finishes.
   
   <!-- mergelens:review -->



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