Re: [chrony-users] Force immediate verification of NTP server status

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


On Wed, Aug 23, 2023 at 04:32:04PM -0700, Thangalin wrote:
> It seems chrony takes non-deterministic time of approximately 1 second to
> determine that the NTP server is offline.
> 
> Can we force chronyd to refresh its state immediately, such that upon
> returning from the request (or command) the State is guaranteed Selectable
> for a valid connection and Nonselectable when severed?

Selectable and Nonselectable are only loosly related to reachability.
chronyc commands cannot be blocking due to the server side of the
protocol being stateless.

If you expect responses to all requests (e.g. in local network),
I think the best thing can do is to poll ntpdata and wait for
"Transmitted messages" to increase by 2 while "Received valid
messages" stays the same. Increase by 1 is not sufficient as you could
be polling in the middle of the NTP exchange.

> Do we need to call something similar to the following:
> 
> chronyc -m 'burst 3/3' 'makestep 0.1 3'

makestep shouldn't make a difference for you. burst still has an
initial delay of at least 0.2 seconds and it doesn't block, but it
should shorten the time needed send two requests.

-- 
Miroslav Lichvar


-- 
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/