You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/04/08 23:09:05 UTC

[GitHub] [cassandra] jonmeredith commented on a diff in pull request #1559: CASSANDRA-17524 shutdown gossip on drain trunk

jonmeredith commented on code in PR #1559:
URL: https://github.com/apache/cassandra/pull/1559#discussion_r846533211


##########
src/java/org/apache/cassandra/concurrent/Stage.java:
##########
@@ -152,6 +167,18 @@ public static void shutdownNow()
         ExecutorUtils.shutdownNow(executors());
     }
 
+    public static void shutdownAndAwaitMutatingExecutors(boolean interrupt, long timeout, TimeUnit units) throws InterruptedException, TimeoutException
+    {
+        List<ExecutorPlus> executors = mutatingExecutors();
+        ExecutorUtils.shutdown(interrupt, executors);
+        ExecutorUtils.awaitTermination(timeout, units, executors);

Review Comment:
   Yes, `ExecutorUtils.awaitTermination()` will stop waiting for the other executors as soon as it hits a timeout awaiting. Not an issue in this case, but it is interesting that if there was an exception before waiting for a {{Thread}}, it would never be joined.



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org