Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2228

WorkerReceiver's main loop (in FastLeaderElection's) should break loop upon restart

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • server
    • None

    Description

      It seems like in FastLeaderElection#Messenger#WorkerReceiver the main loop should be left immediately after this path [0] is taken:

                                             if (!rqv.equals(curQV)) {
                                                 LOG.info("restarting leader election");
                                                 self.shuttingDownLE = true;
                                                 self.getElectionAlg().shutdown();
                                             }
      

      Instead, it keeps going which means the received message would still be applied and a new message might be send out. Should there be a break statement right after self.getElectionAlg().shutdown()?

      Any ideas shralex?

      [0]: https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java#L300

      Attachments

        Activity

          People

            Unassigned Unassigned
            rgs Raúl Gutiérrez Segalés
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: