Re: [chrony-users] "chronyc waitsync" never completes if first server connection attempts fail |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
> On 26 Jan 2022, at 09:39, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
>
> 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?
I’m happy for you to make the commit with a comment, thanks!
Regards,
Jan M.
--
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.