]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: peers: Update peers section state from a thread-safe manner
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Mar 2024 16:39:04 +0000 (17:39 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 Apr 2024 08:29:21 +0000 (10:29 +0200)
commit9425aeaffb128c31bc25581345dd7ae9958afbaf
tree8ddd0c95790a8fc032e61181831cb95acabe70ff
parentef066fa1867a493ef224cf4a18bed54775d4cd29
BUG/MAJOR: peers: Update peers section state from a thread-safe manner

It is the main part of this series. In the peer applet, only the peer flags
are updated. It is now the responsibility of the resync process function to
check changes on each peer to update the peers section state accordingly.

Concretly, changes on the connection state (accepted, connected, released or
renewed) are first reported at the peer level and then handled in
__process_peer_state() function.

In the same manner, when the learn status of a peer changes, the peers
section state is no longer updated immediately. The resync task is woken up
to deal with this changes.

Thanks to these changes, the peers should be now really thread-safe.

This patch relies on the following ones:

  * BUG/MINOR: peers: Report a resync was explicitly requested from a thread-safe manner
  * MINOR: peers: Add functions to commit peer changes from the resync task
  * MINOR: peers: sligthly adapt part processing the stopping signal
  * MINOR: peers: Add flags to report the peer state to the resync task
  * MINOR: peers: Add 2 peer flags about the peer learn status
  * MINOR: peers: Split resync process function to separate running/stopping states

No bug was reported about the thread-safety of peers. Only a performance
issue was encountered with a huge number of peers (> 50). So there is no
reason to backport all these patches further than 2.9.
src/peers.c