rohangarg commented on code in PR #13499:
URL: https://github.com/apache/druid/pull/13499#discussion_r1040115404


##########
server/src/main/java/org/apache/druid/server/coordination/ChangeRequestHistory.java:
##########
@@ -74,11 +76,24 @@ public ChangeRequestHistory(int maxSize)
     this.singleThreadedExecutor = 
Execs.singleThreaded("SegmentChangeRequestHistory");
   }
 
+  public void stop()
+  {
+    singleThreadedExecutor.shutdownNow();
+    final LinkedHashSet<CustomSettableFuture<?>> futures = new 
LinkedHashSet<>(waitingFutures.keySet());
+    waitingFutures.clear();
+    for (CustomSettableFuture<?> theFuture : futures) {
+      theFuture.setException(new IllegalStateException("Server is shutting 
down."));
+    }
+  }
+
   /**
    * Add batch of segment changes update.
    */
   public synchronized void addChangeRequests(List<T> requests)
   {
+    if (singleThreadedExecutor.isShutdown()) {

Review Comment:
   Thanks for the clarification - letting all shutdowns being managed by the 
discovery makes sense to me! 



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