]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: leastconn: Protect tree_elt with the lbprm lock
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 3 Jun 2025 02:37:26 +0000 (02:37 +0000)
committerOlivier Houchard <cognet@Oliviers-MacBook-Pro.local>
Tue, 3 Jun 2025 02:42:47 +0000 (04:42 +0200)
commit913b2d6c83b7b4c7a35b2cef479eb3ab1a471a01
tree66eca9487a607295d95f3b25622216aafccc5f39
parent368d01361a398996faa82047ce75c2298072d4fa
BUG/MAJOR: leastconn: Protect tree_elt with the lbprm lock

In fwlc_srv_reposition(), set the server's tree_elt while we still hold
the lbprm read lock. While it was protected from concurrent
fwlc_srv_reposition() calls by the server's lb_lock, it was not from
dequeuing/requeuing that could occur if the server gets down/up or its
weight is changed, and that would lead to inconsistencies, and the
watchdog killing the process because it is stuck in an infinite loop in
fwlc_get_next_server().

This hopefully fixes github issue #2990.

This should be backported to 3.2.
src/lb_fwlc.c