Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.IOException;
import java.lang.Thread.UncaughtExceptionHandler;
import java.net.MalformedURLException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import org.apache.bookkeeper.bookie.BookieCriticalThread;
import org.apache.bookkeeper.bookie.BookieImpl;
Expand Down Expand Up @@ -94,7 +95,11 @@ public AutoRecoveryMain(ServerConfiguration conf, StatsLogger statsLogger)
MetadataClientDriver metadataClientDriver = bkc.getMetadataClientDriver();
metadataClientDriver.setSessionStateListener(() -> {
LOG.error("Client connection to the Metadata server has expired, so shutting down AutoRecoveryMain!");
shutdown(ExitCode.ZK_EXPIRED);
// do not run "shutdown" in the main ZooKeeper client thread
// as it performs some blocking operations
CompletableFuture.runAsync(() -> {
shutdown(ExitCode.ZK_EXPIRED);
});
});

auditorElector = new AuditorElector(
Expand Down