mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
Apparently seamingless commit 0591bf7deb ("MINOR: listener: make the wait paths cleaner and more reliable") caused a nasty regression and revealed a rare race that hits regtest stickiness/lb-services.vtc about 4% of the times for 8 threads. The problem is that when a multi-threaded listener wakes up on an incoming connection, several threads can receive the event, especially when idle. And all of them will race to accept the connections in parallel, adjusting the listener's nbconn and proxy's feconn until one reaches the proxy's limit and declines. At this step the changes are cancelled, the listener is marked "limited", and when the threads exit the function, one of them will unlimit the listener/proxy again so that it can accept incoming connections again. The problem happens when many threads connect to a small peers section because its maxconn is very limited (typically 6 for 2 peers), and it's sometimes possible for enough competing threads to hit the limit and one of them will limit the listener and queue the proxy's task... except that peers do not initialize their proxy task since they do not use rate limiting. Thus the process crashes when doing task_schedule(p->task). Prior to the cleanup patch above, this didn't happen because the error path that was dedicated to only limiting the listener did not call task_schedule(p->task). Given that the proxy's task is optional, and that the expire value passed there is always TICK_ETERNITY, it's sufficient and reasonable to avoid calling this task_schedule() when expire is not set. And for long term safety we can also avoid to do it when the task is not set. A first fix consisted in allocating a task for the peers proxies but it's never used and would eat resources for reason. No backport is needed as this commit was only merged into 2.2.
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)
Description
Languages
C
98.1%
Shell
0.8%
Makefile
0.5%
Lua
0.2%
Python
0.2%