]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: leastconn: do not loop forever when facing saturated servers
authorWilly Tarreau <w@1wt.eu>
Sat, 17 May 2025 07:54:49 +0000 (09:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 17 May 2025 08:44:36 +0000 (10:44 +0200)
commit6be02d1c6eed0e35e43ca35697501ba688a4da8f
tree125ae2707ebd04ad314c17df693bad2f6cc57d31
parentccc65012d35908f36d9516420203f3a2fd808052
BUG/MAJOR: leastconn: do not loop forever when facing saturated servers

Since commit 9fe72bba3 ("MAJOR: leastconn; Revamp the way servers are
ordered."), there's no way to escape the loop visiting the mt_list heads
in fwlc_get_next_server if all servers in the list are saturated,
resulting in a watchdog panic. It can be reproduced with this config
and injecting with more than 2 concurrent conns:

    balance leastconn
    server s1 127.0.0.1:8000 maxconn 1
    server s2 127.0.0.1:8000 maxconn 1

Here we count the number of saturated servers that were encountered, and
escape the loop once the number of remaining servers exceeds the number
of saturated ones. No backport is needed since this arrived in 3.2.
src/lb_fwlc.c