BUG/MEDIUM: peers: Be sure to always refresh recconnect timer in sync task
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Oct 2023 05:48:26 +0000 (07:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 19 Oct 2023 13:26:43 +0000 (15:26 +0200)
commitcebeab3d2096e7480134e3fa996a904d0b9cdf55
tree8d162892bad0e2c60b9ecbcee04e3b07d9c2f68f
parentf08322b56c0a17f3f09c0d949f6207b512db873b
BUG/MEDIUM: peers: Be sure to always refresh recconnect timer in sync task

A sync task used to manage reconnect, sessions creation or shutdown and data
synchronization is responsible to refresh reconnect and heartbeat timers for
each remote peers and trigger applets wakeup. These timers are used to
refresh the sync task timeer itself. Thus it is important to take care to
always properly refresh them.

However, when there are some data to push, the reconnect timer is not
checked. It may be expired and not refreshed. In this case, an expired timer
may be used to the sync task, leading to a storm of wakeups. The sync task
is woken up in loop because its timer is in the past, waking up Peer applets
at each time.

To fix the issue, the peer's reconnect timer is now refresh to the default
reconnect timeout, if necessary, when there are some data to push.

This patch must be backported to all stable versions.
src/peers.c