[ https://issues.apache.org/jira/browse/ZOOKEEPER-2687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15867686#comment-15867686 ]
ASF GitHub Bot commented on ZOOKEEPER-2687: ------------------------------------------- Github user rakeshadr commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/176#discussion_r101259308 --- Diff: src/java/main/org/apache/zookeeper/server/quorum/Leader.java --- @@ -590,8 +590,8 @@ void lead() throws IOException, InterruptedException { // check leader running status if (!this.isRunning()) { - shutdown("Unexpected internal error"); - return; + shutdownMessage = "Unexpected internal error"; --- End diff -- Good catch @arshadmohammad. Yes, this is another code where it can leads to deadlock similar to ZK-2380. As we know, `shutdownMessage` is acting as flag. Could you please add comments to make this clear, `// set shutdown flag` `shutdownMessage` = "Unexpected internal error";` > Deadlock while shutting down the Leader server. > ----------------------------------------------- > > Key: ZOOKEEPER-2687 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2687 > Project: ZooKeeper > Issue Type: Bug > Components: server > Affects Versions: 3.5.2, 3.6.0 > Reporter: Mohammad Arshad > Assignee: Mohammad Arshad > Fix For: 3.5.3, 3.6.0 > > Attachments: ZOOKEEPER-2687-01.patch > > > Leader server enters into deadlock while shutting down. This happens some > time only. > The reason and deadlock flow is same as ZOOKEEPER-2380. > shutdown was removed from synchronized block in ZOOKEEPER-2380 > Now shutdown is called from synchronized block from another place. > {code} > // check leader running status > if (!this.isRunning()) { > shutdown("Unexpected internal error"); > return; > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)