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

correct the annotation/comment about the frequency of leader's ping

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      // We ping twice a tick, so we only update the tick every other
      // iteration
      boolean tickSkip = true;
      // If not null then shutdown this leader
      String shutdownMessage = null;
      

      From the code, we can find it's a factual mistake. We ping half of a tick time, not twice a tick. For example, the tickTime is 2000ms(default), we ping every 1 s. 

      long start = Time.currentElapsedTime();
      long cur = start;
      long end = start + self.tickTime / 2;
      while (cur < end) {
          wait(end - cur);
          cur = Time.currentElapsedTime();
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            maoling Ling Mao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: