]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: haproxy/threads: try to make all threads leave together
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2020 16:28:01 +0000 (17:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2020 18:17:19 +0000 (19:17 +0100)
commit4b3f27b67f2dec16bc06084df2dfe9f20072584e
tree022588192328e06ed13add8da320684435cef288
parenta7da5e8dd058ee1e283a06342e9701a8eca78ac6
BUG/MINOR: haproxy/threads: try to make all threads leave together

There's a small issue with soft stop combined with the incoming
connection load balancing. A thread may dispatch a connection to
another one at the moment stopping=1 is set, and the second one could
stop by seeing (jobs - unstoppable_jobs) == 0 in run_poll_loop(),
without ever picking these connections from the queue. This is
visible in that it may occasionally cause a connection drop on
reload since no remaining thread will ever pick that connection
anymore.

In order to address this, this patch adds a stopping_thread_mask
variable by which threads acknowledge their willingness to stop
when their runqueue is empty. And all threads will only stop at
this moment, so that if finally some late work arrives in the
thread's queue, it still has a chance to process it.

This should be backported to 2.1 and 2.0.
src/haproxy.c