xiang092689 opened a new issue, #4016:
URL: https://github.com/apache/bookkeeper/issues/4016

   **BUG REPORT**
   Bookie server runtime.exit() never trigger after registerBookie failed
   ```
   try {
       stateManager.registerBookie(true).get();
   } catch (Exception e) {
       LOG.error("Couldn't register bookie with zookeeper, shutting down : ", 
e);
       shutdown(ExitCode.ZK_REG_FAIL);
   }
   ```
   ***Describe the bug***
   
   After zookeeper and bookkeeper shutdown ungracefully
   bookkeeper startup before zookeeper
   
   **Log:**
   ```
   Couldn't register bookie with zookeeper, shutting down : 
   java.util.concurrent.ExecutionException: java.io.IOException: 
org.apache.bookkeeper.bookie.BookieException$MetadataStoreException: 
java.io.IOException: ZK exception checking and wait ephemeral znode xxx expired
   ```
   
   i'am sorry, i can't show more log for some reason. but it is the key log.
    
   
   ***To Reproduce***
   
   1. modify zookeeper config ticktime bigger. such as 200s. easy to reproduce
   2. shutdown bookkeeper and zookeeper **ungracefully**
   3. make bookkeeper start up before zookeeper
   4. bookkeeper can startup failed for other reason, i set it in k8s, crashed 
bookkeeper will start up again till the described bug come up
   
   ***Expected behavior***
   throw exception in blow **catch** block will trigger exceptionhandler and 
shutdown hook and fix this problem
   ```
   try {
       stateManager.registerBookie(true).get();
   } catch (Exception e) {
       LOG.error("Couldn't register bookie with zookeeper, shutting down : ", 
e);
       shutdown(ExitCode.ZK_REG_FAIL);
   }
   ```
   
   but i wonder why **shutdown()** don't close future in the main thread
   it seem that trigger exceptionhandler and shutdownhook can only be trigger 
by unhandled exception
   
   there should be better way to fix.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to