]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: queues: Stricly respect maxconn for outgoing connections
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 17 Dec 2024 13:30:46 +0000 (13:30 +0000)
committerOlivier Houchard <cognet@ci0.org>
Tue, 24 Dec 2024 13:10:06 +0000 (14:10 +0100)
commit3372a2ea000dbfa29a1fcb5643e7e259603ec331
tree1d58bc719edd04ed0b40c4a58e3d9937c065f5df
parent4332fed6c1031fa2f28af4777c45fd84a724ce99
BUG/MEDIUM: queues: Stricly respect maxconn for outgoing connections

The "served" field of struct server is used to know how many connections
are currently in use for a server. But served used to be incremented way
after the server was picked, so there were race conditions that could
lead more than maxconn connections to be allocated for one server. To
fix this, increment served way earlier, and make sure at the time that
it never goes past maxconn.
We now should never have more outgoing connections than set by maxconn.
src/backend.c
src/queue.c
src/stream.c