mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-11 04:11:10 +01:00
Aurelien Darragon found a case of leak when working on ticket #2184. When a reexec_on_failure() happens *BEFORE* protocol_bind_all(), the worker is not fork and the mworker_proc struct is still there with its 2 socketpairs. The socketpair that is supposed to be in the master is already closed in mworker_cleanup_proc(), the one for the worker was suppposed to be cleaned up in mworker_cleanlisteners(). However, since the fd is not bound during this failure, the fd is never closed. This patch fixes the problem by setting the fd to -1 in the mworker_proc after the fork, so we ensure that this it won't be close if everything was done right, and then we try to close it in mworker_cleanup_proc() when it's not set to -1. This could be triggered with the script in ticket #2184 and a `ulimit -H -n 300`. This will fail before the protocol_bind_all() when trying to increase the nofile setrlimit. In recent version of haproxy, there is a BUG_ON() in fd_insert() that could be triggered by this bug because of the global.maxsock check. Must be backported as far as 2.6. The problem could exist in previous version but the code is different and this won't be triggered easily without other consequences in the master.
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.9%
Makefile
0.5%
Lua
0.2%
Python
0.1%