Skip to content

Commit

Permalink
ZOOKEEPER-2687: Deadlock while shutting down the Leader server
Browse files Browse the repository at this point in the history
Leader server enters into deadlock while shutting down itself. Shutdown of the leader server is called from the synchronized block which must be called from outside the synchronized block. For detail pls refer ZOOKEEPER-2380

Author: Mohammad Arshad <[email protected]>

Reviewers: Abraham Fine <[email protected]>, Rakesh Radhakrishnan <[email protected]>

Closes apache#176 from arshadmohammad/ZOOKEEPER-2687 and squashes the following commits:

7551f5c [Mohammad Arshad] Fixed Rakesh's comments
1e3ed70 [Mohammad Arshad] ZOOKEEPER-2687:Deadlock while shutting down the Leader server.
  • Loading branch information
arshadmohammad authored and rakeshadr committed Feb 15, 2017
1 parent 15e3f7f commit fd211a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/java/main/org/apache/zookeeper/server/quorum/Leader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit fd211a5

Please sign in to comment.