]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: server: prevent deadlock when using 'set maxconn server'
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 17 May 2021 08:47:18 +0000 (10:47 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 19 May 2021 15:52:05 +0000 (17:52 +0200)
commit79a88ba3d09f7e2b73ae27cb5d24cc087a548fa6
tree485790f47543604a155f9878803263a05de0747d
parent2608e348bec8a533225424fad06760ce6e19f167
BUG/MAJOR: server: prevent deadlock when using 'set maxconn server'

A deadlock is possible with 'set maxconn server' command, if there is
pending connection ready to be dequeued. This is caused by the locking
of server spinlock in both cli_parse_set_maxconn_server and
process_srv_queue.

Fix this by reducing the scope of the server lock into
server_parse_maxconn_change_request. If connection are dequeued, the
lock is taken a second time. This can be seen as suboptimal but as it
happens only during 'set maxconn server' it can be considered as
tolerable.

This issue was reported on the mailing list, for the 1.8.x branch.
It must be backported up to the 1.8.
src/server.c