Re: Force immediate verification of NTP server status

Miroslav Lichvar <[email protected]>
Newsgroups gmane.comp.time.chrony.user
Message-ID <ZObnhcMRGnT3NHAL@localhost>
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-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "unsubscribe" in the subject.
For help email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "help" in the subject.
Trouble?  Email [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.