lhotari commented on code in PR #4165:
URL: https://github.com/apache/bookkeeper/pull/4165#discussion_r1447982981
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorElector.java:
##########
@@ -238,8 +241,16 @@ public void shutdown() throws InterruptedException {
return;
}
// close auditor manager
- submitShutdownTask();
- executor.shutdown();
+ try {
+ submitShutdownTask().get(10, TimeUnit.SECONDS);
+ executor.shutdown();
+ } catch (ExecutionException e) {
+ LOG.warn("Failed to close auditor manager", e);
+ executor.shutdownNow();
+ } catch (TimeoutException e) {
+ LOG.warn("Failed to close auditor manager in 10 seconds", e);
+ executor.shutdownNow();
Review Comment:
I wonder if it would be necessary to set running to false in these
exceptional cases so that the other thread that checks that value would exit?
https://github.com/apache/bookkeeper/blob/405e72acf42bb1104296447ea8840d805094c787/bookkeeper-server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fbookkeeper%2Freplication%2FAutoRecoveryMain.java#L234
--
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]