]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: peers: account incoming sessions in the per-thread applet counters
authorFrederic Lecaille <flecaille@haproxy.com>
Fri, 23 Oct 2026 09:46:36 +0000 (11:46 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 26 Oct 2026 10:39:41 +0000 (11:39 +0100)
commit2f60e4335310617e53ebf28578b25291d7c78809
tree3ca75525b089a0ab86261ccf2b3f8b86fc224ae6
parent690801bed3fb1cc41877b830f0a8d5d762d961f9
BUG/MINOR: peers: account incoming sessions in the per-thread applet counters

The per-thread applet counters of a peers section are used to pick the
least loaded thread when creating an outgoing peer session. They are
incremented in peer_session_create() for outgoing sessions only, but
decremented in __peer_session_deinit() for all sessions, including
incoming ones. Each incoming session thus makes the counter of its thread
drift towards negative values, and outgoing sessions then tend to be
created on the threads which handled incoming ones, defeating the load
balancing.

Must be backported as far as 3.0.
src/peers.c