mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-26 06:32:13 +00:00
haproxy public development tree
d7a6b2f742
Currently the soft-stop can lead to old processes remaining alive for as long as two seconds after receiving a soft-stop signal. What happens is that when receiving SIGUSR1, one thread (usually the first one) wakes up, handles the signal, sets "stopping", goes into runn_poll_loop(), and discovers that stopping is set, so its also sets itself in the stopping_thread_mask bit mask. After this it sees that other threads are not yet willing to stop, so it continues to wait. From there, other threads which were waiting in poll() expire after one second on poll timeout and enter run_poll_loop() in turn. That's already one second of wait time. They discover each in turn that they're stopping and see that other threads are not yet stopping, so they go back waiting. After the end of the first second, all threads know they're stopping and have set their bit in stopping_thread_mask. It's only now that those who started to wait first wake up again on timeout to discover that all other ones are stopping, and can now quit. One second later all threads will have done it and the process will quit. This is effectively strictly larger than one second and up to two seconds. What the current patch does is simple, when the first thread stops, it sets its own bit into stopping_thread_mask then wakes up all other threads to do also set theirs. This kills the first second which corresponds to the time to discover the stopping state. Second, when a thread exists, it wakes all other ones again because some might have gone back sleeping waiting for "jobs" to go down to zero (i.e. closing the last connection). This kills the last second of wait time. Thanks to this, as SIGUSR1 now acts instantly again if there's no active connection, or it stops immediately after the last connection has left if one was still present. This should be backported as far as 2.0. |
||
---|---|---|
.github | ||
contrib | ||
doc | ||
ebtree | ||
examples | ||
include | ||
reg-tests | ||
scripts | ||
src | ||
tests | ||
.cirrus.yml | ||
.gitignore | ||
.travis.yml | ||
BRANCHES | ||
CHANGELOG | ||
CONTRIBUTING | ||
INSTALL | ||
LICENSE | ||
MAINTAINERS | ||
Makefile | ||
README | ||
ROADMAP | ||
SUBVERS | ||
VERDATE | ||
VERSION |
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)