mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 05:41:26 +02:00
Till now when a wakeup happens after a connection is attempted, we go through sess_update_st_con_tcp() to deal with the various possible events, then to sess_update_st_cer() to deal with a possible error detected by the former, or to sess_establish() to complete the connection validation. There are multiple issues in the way this is handled, which have accumulated over time. One of them is that any spurious wakeup during SI_ST_CON would validate the READ_ATTACHED flag and wake the analysers up. Another one is that nobody feels responsible for clearing SI_FL_EXP if it happened at the same time as a success (and it is present in all reports of loops to date). And another issue is that aborts cannot happen after a clean connection setup with no data transfer (since CF_WRITE_NULL is part of CF_WRITE_ACTIVITY). Last, the flags cleanup work was hackish, added here and there to please the next function (typically what had to be donne in commit 7a3367cca to work around the url_param+reuse issue by moving READ_ATTACHED to CON). This patch performs a significant lift up of this setup code. First, it makes sure that the state handlers are the ones responsible for the cleanup of the stuff they rely on. Typically sess_sestablish() will clean up the SI_FL_EXP flag because if we decided to validate the connection it means that we want to ignore this late timeout. Second, it splits the CON and RDY state handlers because the former only has to deal with failures, timeouts and non-events, while the latter has to deal with partial or total successes. Third, everything related to connection success was moved to sess_establish() since it's the only safe place to do so, and this function is also called at a few places to deal with synchronous connections, which are not seen by intermediary state handlers. The code was made a bit more robust, for example by making sure we always set SI_FL_NOLINGER when aborting a connection so that we don't have any risk to leave a connection in SHUTW state in case it was validated late. The useless return codes of some of these functions were dropped so that callers only rely on the stream-int's state now (which was already partially the case anyway). The code is now a bit cleaner, could be further improved (and functions renamed) but given the sensitivity of this part, better limit changes to strictly necessary. It passes all reg tests.
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)
Description
Languages
C
98.1%
Shell
0.8%
Makefile
0.5%
Lua
0.2%
Python
0.2%