mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
In Linux kernel's net/ipv4/udp.c there's a udp_disconnect() function which is called when connecting to AF_UNSPEC, and which unhashes a "connection". This property, which is also documented in connect(2) both in Linux and Open Group's man pages for datagrams, is interesting because it allows to reverse a connect() which is in fact a filter on the source. As such we can suspend a receiver by making it connect to itself, which will cause it not to receive any traffic anymore, letting a new one receive it all, then resume it by breaking this connection. This was tested to work well on Linux, other operating systems should also be tested. Before this, sending a SIGTTOU to a process having a UDP syslog forwarder would cause this error: [WARNING] 280/194249 (3268) : Paused frontend GLOBAL. [WARNING] 280/194249 (3268) : Some proxies refused to pause, performing soft stop now. [WARNING] 280/194249 (3268) : Proxy GLOBAL stopped (cumulated conns: FE: 0, BE: 0). [WARNING] 280/194249 (3268) : Proxy sylog-loadb stopped (cumulated conns: FE: 0, BE: 0). With this change, it now proceeds just like with TCP listeners: [WARNING] 280/195503 (3885) : Paused frontend GLOBAL. [WARNING] 280/195503 (3885) : Paused frontend sylog-loadb. And SIGTTIN also works: [WARNING] 280/195507 (3885) : Resumed frontend GLOBAL. [WARNING] 280/195507 (3885) : Resumed frontend sylog-loadb. On Linux this also works with TCP listeners (which can then be resumed using listen()) and established TCP sockets (which we currently kill using setsockopt(so_linger)), both not being portable on other OSes. UNIX sockets and ABNS sockets do not support it however (connect always fails). This needs to be further explored to see if other OSes might benefit from this to perform portable and reliable resets particularly on the backend side.
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%