You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/09/10 15:45:01 UTC

[GitHub] [bookkeeper] MarvinCai commented on issue #3351: Auditor exits silently on ZK timeout

MarvinCai commented on issue #3351:
URL: https://github.com/apache/bookkeeper/issues/3351#issuecomment-1242756625

   @dlg99 according this code snippet, the DeatchWather should be able to catch the case and shut down the whole autorecovery right? https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java#L213-L240
          ```
        setUncaughtExceptionHandler((thread, cause) -> {
                   LOG.info("AutoRecoveryDeathWatcher exited loop due to uncaught exception from thread {}",
                       thread.getName(), cause);
                   shutdown();
               });
           }
   
           @Override
           public void run() {
               while (true) {
                   try {
                       Thread.sleep(watchInterval);
                   } catch (InterruptedException ie) {
                       Thread.currentThread().interrupt();
                   }
                   // If any one service not running, then shutdown peer.
                   if (!autoRecoveryMain.auditorElector.isRunning() || !autoRecoveryMain.replicationWorker.isRunning()) {
                       LOG.info(
                               "AutoRecoveryDeathWatcher noticed the AutoRecovery is not running any more,"
                               + "exiting the watch loop!");
                       /*
                        * death watcher has noticed that AutoRecovery is not
                        * running any more throw an exception to fail the death
                        * watcher thread and it will trigger the uncaught exception
                        * handler to handle this "AutoRecovery not running"
                        * situation.
                        */
                       throw new RuntimeException("AutoRecovery is not running any more");
                   }
   ```


-- 
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: commits-unsubscribe@bookkeeper.apache.org

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