[chrony-users] Multi-source: No source change from unreachable to reachable one

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

There is an issue in changing between two sources, when preferred source becomes unreachable.
I am using timemaster and having one NTP source and one SHM source (based on PTP).

refclock SHM 0 poll 2 dpoll 0 refid PTP0 precision 1.0e-9 delay 1.0e-04 prefer
server iburst minpoll 2

When the PTP does loose sync and the reachability becomes, 0 SHM source remains selected source forever.

Looking deeper,  the issue lies in the lines in source.c:704 (chrony v.3.5)

    /* Reachability is not a requirement for selection.  An unreachable source
       can still be selected if its newest sample is not older than the oldest
       sample from reachable sources. */
    if (!sources[i]->reachability && max_reach_sample_ago < si->last_sample_ago) {
      sources[i]->status = SRC_STALE;

where as far as I understood:
 - max_reach_sample_ago is the time where the first valid sample from any reachable source is received
 - s-> last_sample_ago is the time when the last sample was received from non-reachable source

When SHM source looses reachability, each second both s-> last_sample_ago and max_reach_sample_ago are increased by one 
The condition never becomes true and the unreachable(invalid) source remains the selected source forever.

I did not really understand the intention for this a comparison.
Was it indented to compare newest sample from unreachable source with the newest sample from reachable source instead?

If it is required to stay with the unreachable source at all times, trust  config option would be more suitable then prefer option. I would assume the sources with prefer option should only stay selected if source is valid and reachable.

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

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