This is an automated email from the ASF dual-hosted git repository.

ivank pushed a commit to branch branch-4.6
in repository

The following commit(s) were added to refs/heads/branch-4.6 by this push:
     new 3b232d6  Fix shutdown race which left ZK session open
3b232d6 is described below

commit 3b232d6de2f5d40fde39746e25cf9aea33ab6bec
Author: Ivan Kelly <>
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 <>
    Reviewers: Enrico Olivelli <>, Sijie Guo 
    This closes #1132 from ivankelly/shut-race
    (cherry picked from commit 89eca5ce717a04c6e3ffa2b0aca615f4e38eafe3)
    Signed-off-by: Ivan Kelly <>
 bookkeeper-server/src/main/java/org/apache/bookkeeper/server/ | 1 -
 1 file changed, 1 deletion(-)

diff --git 
index c2f7b8e..5ee8bb5 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/
@@ -219,7 +219,6 @@ public class Main {
             // the server is interrupted
   "Bookie server is interrupted. Exiting ...");
-        server.close();
         return ExitCode.OK;

To stop receiving notification emails like this one, please contact

Reply via email to