]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: peers: Fix state transitions of a peer
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Apr 2024 14:50:08 +0000 (16:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Apr 2024 15:08:22 +0000 (17:08 +0200)
commitd43f0e7f5a8c3f3d26de7032fc74ea92d8fa0e34
treecf504eb6780e898b07aaaf837b322782816fc685
parentc0b2015aae9a79d17e4479abd8d453bc91378e3a
BUG/MEDIUM: peers: Fix state transitions of a peer

The commit 9425aeaffb ("BUG/MAJOR: peers: Update peers section state from a
thread-safe manner") introduced regressions about state transitions of a
peer.

A peer may be in a connected, accepted or released state. Before, changes for
these states were performed synchronously. Since the commit above, changes
are mainly performed in the sync process task.

The first regression was about the released then accepted state transition,
called the renewed state. In reality the state was always crushed by the
accepted state. After some review, the state was just removed to always
perform the cleanup in the sync process task before acknowledging the
connected or accepted states.

Then, a wakeup of the peer applet was missing from the sync process task
after the ack of connected or accepted states, blocking the applet.

Finally, when a peer is in released, connected or accepted state, we must
take care to wait the sync process task wakeup before trying to receive or
send messages.

This patch must only be backported if the above commit is backported.
src/peers.c