You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by "behos (via GitHub)" <gi...@apache.org> on 2023/06/08 11:46:00 UTC

[GitHub] [zookeeper] behos commented on a diff in pull request #1898: ZOOKEEPER-4400 Zookeeper not getting Graceful Termination

behos commented on code in PR #1898:
URL: https://github.com/apache/zookeeper/pull/1898#discussion_r1222925648


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServerMain.java:
##########
@@ -180,6 +180,10 @@ public void runFromConfig(ServerConfig config) throws IOException, AdminServerEx
 
             serverStarted();
 
+            if (config.registerShutdownHook()) {
+                Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown));
+            }

Review Comment:
   Could this interact with the main `shutdownLatch` (which we `await` for right below)?
   
   That's triggered by running the `zkServer`'s `shutdown` https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java#LL935C31-L935C31
   
   Then we can use the common shutdown path in both cases.



-- 
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: notifications-unsubscribe@zookeeper.apache.org

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