Re: [chrony-users] "chronyc waitsync" never completes if first server connection attempts fail |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-users] "chronyc waitsync" never completes if first server connection attempts fail
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 26 Jan 2022 09:39:25 +0100
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643186370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jJgJzuOIx/n1CMajtrC/BvyXJrx8DD31a8qpGkCNVSw=; b=AUaA3ho+//hFJ/6GPM3WHAMfIoKJmqC5UPHuyz+NAMXHo+xbQqprzk0g2/z1UBgZhGtYzQ TDe5KbjP4sh2PiAoD5K92wzKkG75kADJz45L8cvbOI1Xs92hR1BNgA474+Z1OsE49c1e9+ VJ9jNJJcR+H5TMJWPrpGZUSQoGZs0ds=
On Tue, Jan 25, 2022 at 07:41:42PM +0100, Jan Mikkelsen wrote:
> Hi,
>
> I have just been looking at using “chronyc waitsync” in startup scripts for processes that need an accurate time.
>
> I noticed that waitsync never successfully connects to the server if the first connection attempts fail. This is the case if the chronyc process starts before the chronyd process starts listening.
>
> The patch below fixes it for me. The change is in client.c, open_io(). When the loop in open_io() fails to open any servers, it resets the address index so that a subsequent call to open_io() (as in the waitsync loop) retries connections to all the servers.
Good catch. The fix looks good to me. I'd just add a comment like
"Start from the first address if called again" before that line.
Would you like to submit the patch as a git commit with an explanation
of the bug, or would you be ok if I did that and added your mail as
Reported-by?
--
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.