This is an automated email from the ASF dual-hosted git repository. ivank pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push: new 89eca5c Fix shutdown race which left ZK session open 89eca5c is described below commit 89eca5ce717a04c6e3ffa2b0aca615f4e38eafe3 Author: Ivan Kelly <iv...@apache.org> AuthorDate: Tue Feb 13 17:52:54 2018 +0100 Fix shutdown race which left ZK session open There was a race when shutting down a bookie, where both the main thread and the shutdown hook thread would try to close the bookie service. This would result in them racing to set the lifecycle state and neither would end up cleaning up properly. Specifically, the starter latch would be counted down, so the main thread would start to close, then the shutdown hook would run, try to close, and get an exception when it tried to change the state. Once the all shutdown hooks end, the process exits, even if main hasn't completed. This leaves the zookeeper session open. I've removed the close from main(). The shutdown hook always runs on a graceful shutdown, so that's the place to do the cleanup. Author: Ivan Kelly <iv...@apache.org> Reviewers: Enrico Olivelli <eolive...@gmail.com>, Sijie Guo <si...@apache.org> This closes #1132 from ivankelly/shut-race --- bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java index c2f7b8e..5ee8bb5 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java @@ -219,7 +219,6 @@ public class Main { // the server is interrupted log.info("Bookie server is interrupted. Exiting ..."); } - server.close(); return ExitCode.OK; } -- To stop receiving notification emails like this one, please contact iv...@apache.org.