haproxy public development tree
Go to file
Willy Tarreau d66ed88a78 MEDIUM: stream: re-arrange the connection setup status reporting
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.
2019-06-06 16:36:19 +02:00
.github/ISSUE_TEMPLATE DOC: add github issue templates 2019-01-17 22:53:55 +01:00
contrib MINOR: htx: Don't use end-of-data blocks anymore 2019-06-05 10:12:11 +02:00
doc MEDIUM: stream-int: introduce a new state SI_ST_RDY 2019-06-06 16:36:19 +02:00
ebtree CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
examples [RELEASE] Released version 2.0-dev5 2019-06-02 12:06:08 +02:00
include MEDIUM: stream-int: make idle-conns switch to ST_RDY 2019-06-06 16:36:19 +02:00
reg-tests REGTEST: Add a basic server by name stickiness reg test. 2019-06-05 08:42:36 +02:00
scripts BUILD: travis-ci improvements 2019-06-05 10:02:42 +02:00
src MEDIUM: stream: re-arrange the connection setup status reporting 2019-06-06 16:36:19 +02:00
tests CLEANUP: fix a misspell in tests/filltab25.c 2018-11-18 22:23:15 +01:00
.cirrus.yml BUILD: enable freebsd builds on cirrus-ci 2019-05-16 09:27:51 +02:00
.gitignore DOC: split the README into README + INSTALL 2018-12-16 22:30:57 +01:00
.travis.yml BUILD: travis-ci improvements 2019-06-05 10:02:42 +02:00
CHANGELOG [RELEASE] Released version 2.0-dev5 2019-06-02 12:06:08 +02:00
CONTRIBUTING DOC: Fix typos in README and CONTRIBUTING 2018-11-12 08:54:12 +01:00
INSTALL Revert "CLEANUP: wurfl: remove dead, broken and unmaintained code" 2019-04-23 10:34:43 +02:00
LICENSE
MAINTAINERS DOC: wurfl: added point of contact in MAINTAINERS file 2019-04-23 11:00:23 +02:00
Makefile MEDIUM: connections: Introduce a handshake pseudo-XPRT. 2019-06-05 18:03:38 +02:00
README DOC: split the README into README + INSTALL 2018-12-16 22:30:57 +01:00
ROADMAP DOC: update the roadmap about priority queues 2018-08-10 17:12:04 +02:00
SUBVERS
VERDATE [RELEASE] Released version 2.0-dev5 2019-06-02 12:06:08 +02:00
VERSION [RELEASE] Released version 2.0-dev5 2019-06-02 12:06:08 +02:00

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)