You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "maoling (Jira)" <ji...@apache.org> on 2020/12/23 10:32:00 UTC

[jira] [Created] (ZOOKEEPER-4036) correct the annotation/comment about the frequency of leader's ping

maoling created ZOOKEEPER-4036:
----------------------------------

             Summary: correct the annotation/comment about the frequency of leader's ping
                 Key: ZOOKEEPER-4036
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4036
             Project: ZooKeeper
          Issue Type: Improvement
            Reporter: maoling


{code:java}
// 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;
{code}
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. 
{code:java}
long start = Time.currentElapsedTime();
long cur = start;
long end = start + self.tickTime / 2;
while (cur < end) {
    wait(end - cur);
    cur = Time.currentElapsedTime();
}
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)