mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-31 10:31:46 +00:00
haproxy public development tree
4ad574fbe2
On some occasions we've had loops happening when processing actions (e.g. a yield not being well understood) resulting in analysers being called in loops until the analysis timeout without incrementing the stream's call count, thus this type of bug cannot be caught by the current protection system. What this patch proposes is to start to measure the time spent in analysers when profiling is enabled on the thread, in order to detect if a stream is really misbehaving. In this case we measured the consumed CPU time, not the wall clock time, so as not to be affected by possible noisy neighbours sharing the same CPU. When more than 100ms are spent in an analyser, we trigger the stream_dump_and_crash() function to report the anomaly. The choice of 100ms comes from the fact that regular calls only take around 1 microsecond and it seems reasonable to accept a degradation factor of 100000, which covers very slow machines such as home gateways running on sub-ghz processors, with extremely heavy configurations. Some complete tests show that even this common bogus map_regm() entry supposedly designed to extract a port from an IP:port entry does not trigger the timeout (25 ms evaluation time for a 4kB header, exercise left to the reader to spot the mistake) : ([0-9]{0,3}).([0-9]{0,3}).([0-9]{0,3}).([0-9]{0,3}):([0-9]{0,5}) \5 However this one purposely designed to kill haproxy definitely dies as it manages to completely freeze the whole process for more than one second on a 4 GHz CPU for only 120 bytes in : (.{0,20})(.{0,20})(.{0,20})(.{0,20})(.{0,20})b \1 This protection will definitely help during the code stabilization period and may possibly be left enabled later depending on reported issues or not. If you've noticed that your workload is affected by this patch, please report it as you have very likely found a bug. And in the mean time you can turn profiling off to disable it. |
||
---|---|---|
.github/ISSUE_TEMPLATE | ||
contrib | ||
doc | ||
ebtree | ||
examples | ||
include | ||
reg-tests | ||
scripts | ||
src | ||
tests | ||
.gitignore | ||
.travis.yml | ||
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 - 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)