You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/07/12 01:41:05 UTC

[GitHub] reddycharan opened a new issue #1540: Bookie/BookieServer components shutdown will fail to end/exit the BookieProcess

reddycharan opened a new issue #1540: Bookie/BookieServer components shutdown will fail to end/exit the BookieProcess
URL: https://github.com/apache/bookkeeper/issues/1540
 
 
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   If Bookie/BookieServer components are shutdown internally because of any fatal errors (ExitCode - INVALID_CONF, SERVER_EXCEPTION, ZK_EXPIRED, ZK_REG_FAIL, BOOKIE_EXCEPTION) then it will go through shutdown method logic and shutdowns components internal to Bookie/BookieServer but it will not succeed in bringing down the bookie process. 
   
   This is because in BookieServer.main / server.Main.doMain it would wait for the startComponent future to complete http://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java#L227 .  The startComponent future will be market complete only in runtime shutdownhook - https://github.com/apache/bookkeeper/blob/master/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/component/ComponentStarter.java#L66. 
   
   But the problem is nowhere in Bookie/BookieProcess shutdown we are calling System.exit() and hence the runtime shutdownhook is not executed to mark the startComponent future to complete. Hence Main.doMain will wait forever on this future though Bookie/BookieServer components are shutdown because of known fatal errors.
   
   Following is the thread callstacktrace of main method which is waiting forever
   (line numbers might not match, since we are using little older code)
   
   main - priority:5 - threadId:0x00007fd60000d000 - nativeId:0x2d37b - state:WAITING
   stackTrace:
   java.lang.Thread.State: WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for <0x00007fcddf015af0> (a java.util.concurrent.CompletableFuture$Signaller)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
   at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1693)
   at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
   at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1729)
   at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
   at org.apache.bookkeeper.server.Main.doMain(Main.java:215)
   at org.apache.bookkeeper.server.Main.main(Main.java:189)
   at org.apache.bookkeeper.proto.BookieServer.main(BookieServer.java:256)
   
   Note: This is regression bug, which must be introduced with lifecycle components introduction.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services