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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated: