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.
This commit is contained in:
Willy Tarreau 2024-11-15 15:44:05 +01:00
parent f66bfcff96
commit ed55ff878d
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
}