From: Willy Tarreau Date: Fri, 15 Nov 2024 14:44:05 +0000 (+0100) Subject: BUG/MINOR: peers: make sure to always apply offsets to now_ms in expiration X-Git-Tag: v3.1-dev13~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed55ff878d5af35dae70f78023ab2141d36e5866;p=thirdparty%2Fhaproxy.git BUG/MINOR: peers: make sure to always apply offsets to now_ms in expiration Now_ms can be zero nowadays, so it's not suitable for direct assignment to t->expire, as there's a risk that the timer never wakes up once assigned (TICK_ETERNITY). Let's use tick_add(now_ms, 0) for an immediate wakeup instead. The impact here might be a reconnect programmed upon signal receipt at the wrapping date not having a working timeout. This should be backported where it applies. --- diff --git a/src/peers.c b/src/peers.c index 5094002b1c..c17e6ecd53 100644 --- a/src/peers.c +++ b/src/peers.c @@ -3609,7 +3609,7 @@ static void __process_stopping_peer_sync(struct task *task, struct peers *peers, /* Set resync timeout for the local peer and request a immediate reconnect */ peers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(PEER_RESYNC_TIMEOUT)); - peers->local->reconnect = now_ms; + peers->local->reconnect = tick_add(now_ms, 0); } }