]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: deinit/threads: make hard-stop-after perform a clean exit
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Jun 2019 09:11:29 +0000 (11:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Jun 2019 09:30:07 +0000 (11:30 +0200)
commit7067b3a92efc9c9a7c3239245fdc96ea7310f46a
tree9cb93467d85a731da015bd7cf3336d22cc6dd1e0
parent76824a8c99c69fad7e70b0914c21ac335959771e
BUG/MINOR: deinit/threads: make hard-stop-after perform a clean exit

As reported in GH issue #99, when hard-stop-after triggers and threads
are in use, the chance that any thread releases the resources in use by
the other ones is non-null. Thus no thread should be allowed to deinit()
nor exit by itself.

Here we take a different approach. We simply use a 3rd possible value
for the "killed" variable so that all threads know they must break out
of the run-poll-loop and immediately stop.

This patch was tested by commenting the stream_shutdown() calls in
hard_stop() to increase the chances to see a stream use released
resources. With this fix applied, it never crashes anymore.

This fix should be backported to 1.9 and 1.8.
include/types/global.h
src/haproxy.c
src/proxy.c