[systemd-devel] [PATCH 8/8] timesyncd: wait before reconnecting to first server
Miroslav Lichvar
mlichvar at redhat.com
Tue Sep 2 04:15:17 PDT 2014
On Fri, Aug 29, 2014 at 06:45:24PM +0200, Kay Sievers wrote:
> On Wed, Aug 27, 2014 at 4:47 PM, Miroslav Lichvar <mlichvar at redhat.com> wrote:
> > When all servers are exhausted, wait for one poll interval before trying
> > to connect again to the first server in the list. Also, keep increasing
> > the polling interval to make sure a client not getting any valid replies
> > will not send requests to any server more frequently than is allowed by
> > the maximum polling interval.
>
> What is the reason to keep track if we asked all servers, and not just
> decrease the frequency of switching them?
Delaying every reconnection by the current polling interval would work
nicely and there could even be an assert for the actual interval
between sending requests for extra safety, but my understanding is
that on start you want to find a good server quickly, or not?
If the first three servers in the list reply as unsynchronized, it
would take 3*32 seconds to switch to the fourth server. With this
patch, the reselection happens immediately after receiving the reply.
Is that acceptable? I can rewrite the patch if you want.
> There is also some code in src/timesync/timesyncd-manager.c +209:
> /* re-arm timer with increasing timeout,
> in case the packets never arrive back */
>
> which used to work but maybe broke with other changes.
In the current code that doesn't work as the 10s reconnect timeout is
always reached first.
--
Miroslav Lichvar
More information about the systemd-devel
mailing list