diff --git a/src/java/main/org/apache/zookeeper/server/quorum/Leader.java b/src/java/main/org/apache/zookeeper/server/quorum/Leader.java index 7bec994d999..13f7ec97183 100644 --- a/src/java/main/org/apache/zookeeper/server/quorum/Leader.java +++ b/src/java/main/org/apache/zookeeper/server/quorum/Leader.java @@ -590,8 +590,9 @@ void lead() throws IOException, InterruptedException { // check leader running status if (!this.isRunning()) { - shutdown("Unexpected internal error"); - return; + // set shutdown flag + shutdownMessage = "Unexpected internal error"; + break; } if (!tickSkip && !syncedAckSet.hasAllQuorums()) {