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";`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to