[chrony-dev] Poll adjust after long time unreachable?

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


I was just looking at adjust_poll in ntp_core.c and am confused by some of the
lines there.
  } else if (inst->local_poll > inst->maxpoll) {
    inst->local_poll = inst->maxpoll;
    inst->poll_score = 1.0;
  }
So if local_poll is larger that maxpoll, it is clamped to maxpoll, but
poll_score is made equal to 1 which means on the next round, it will again be
increment local_poll and go through this round again. Ie, why in this
situation is poll_score set to 1 rather than 0?

Also, after a long time of not reaching the source (tx_count has been
large) and we finally get the source again,
should the poll interval not be dropped back down to something like minpoll so
the system can resynchronize relatively quickly?
(or maybe this does happen somewhere I have not found).

Ie, in lines 1137-1141 of ntp_core.c
   if (valid_header && valid_data) {
    inst->remote_poll = message->poll;
    inst->remote_stratum = message->stratum;
    inst->tx_count = 0;
    SRC_UpdateReachability(inst->source, 1);
do something like
if (inst->tx_count >5 ) inst->local_poll=inst->minpoll;
or
if(inst->txcount>4) adjust_poll( inst, -(double)inst->tx_count/4.);
(this would return it to roughly the same poll count it had before it became
unreachable, but maybe it should drop even more).
before the inst->tx_count = 0;
line.


Ie, during the time the source was unreachable, the poll gradually increased,
but if it comes back after a long time unreachable, one should decrease the
poll interval after it comes back to recover quickly from the missing return
packets. One could get the case where one was on
minpoll when the remote source became unreachable, it gradually increased to
maxpoll while it is unreachable, and then when it comes back, it is stuck on
maxpoll, meaning the system time is left wrong for even longer than necessary.





--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/