haproxy public development tree
Go to file
Aurelien DARRAGON 4cc2714ae2 EXAMPLES: fix race condition in lua mailers script
Christopher reported a rare race condition involving 'healthcheckmail.vtc'

The regtest would randomly FAIL with this kind of error:

    **   S1    === expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server b...
    **** S1    EXPECT MATCH ~ "[^:\[ ]\[581669\]: Health check for server be1/srv1 failed.+check duration: [[:digit:]]+ms.+status: 0/1 DOWN."
    **   S1    === recv info
    **** S1    syslog|<25>May 11 15:38:46 haproxy[581669]: Server be1/srv1 is DOWN. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
    **** S1    syslog|<24>May 11 15:38:46 haproxy[581669]: backend be1 has no server available!

It turns out that this it due to the recent commit 7963fb5 ("REGTESTS: use
lua mailer script for mailers tests") in which we tell the regtest to use
the new lua mailers instead of the legacy mailers API.

However, in the lua mailers script, due to the event subscriptions being
performed from a lua task, it is possible that the subscription may be
delayed during startup. Indeed lua tasks relie on the scheduler which runs
tasks with no ordering guarantees. Thus early tasks, including server
checks which are used in the regtest are competing during startup.

As such, we may end up with some events that are generated right before
the lua mailers script starts subscribing to events (because the lua task
is scheduled but started yet), resulting in events loss from lua point of
view.

To fix this and to make lua mailers more reliable during startup, we now
perform the events subscription from an init function instead of an
asynchronous task. (The init function is called synchronously during
haproxy post_init, and exclusively runs before the scheduler starts)

This should be enough to prevent healthcheckmail.vtc from randomly failing
2023-05-12 09:45:30 +02:00
.github CI: more granular failure on generating build matrix 2023-05-08 14:05:44 +02:00
addons MINOR: tree-wide: use free_acl_cond() where relevant 2023-05-11 15:37:04 +02:00
admin MINOR: acme.sh: add the deploy script for acme.sh in admin directory 2023-04-26 17:32:15 +02:00
dev DEV: flags/show-sess-to-flags: add support for color output 2023-05-10 17:48:00 +02:00
doc DOC: lua: fix core.{proxies,frontends,backends} visibility 2023-05-12 09:45:30 +02:00
examples EXAMPLES: fix race condition in lua mailers script 2023-05-12 09:45:30 +02:00
include MINOR: master/cli: also implement the timed prompt on the master CLI 2023-05-11 16:38:52 +02:00
reg-tests REGTESTS: use lua mailer script for mailers tests 2023-05-05 16:28:32 +02:00
scripts BUILD: ssl: switch LibreSSL to Fastly CDN 2023-04-26 18:41:03 +02:00
src MINOR: ncbuf: missing malloc checks in standalone code 2023-05-12 09:45:30 +02:00
tests
.cirrus.yml CI: cirrus-ci: bump FreeBSD image to 13-1 2023-04-23 09:44:53 +02:00
.gitattributes
.gitignore
.mailmap
.travis.yml
BRANCHES
CHANGELOG [RELEASE] Released version 2.8-dev11 2023-05-11 05:33:21 +02:00
CONTRIBUTING
INSTALL DOC: fix a few reported typos in the config and install doc 2023-05-07 07:10:55 +02:00
LICENSE
MAINTAINERS
Makefile DEBUG: list: add DEBUG_LIST to purposely corrupt list heads after delete 2023-05-11 11:33:35 +02:00
README
SUBVERS
VERDATE [RELEASE] Released version 2.8-dev11 2023-05-11 05:33:21 +02:00
VERSION [RELEASE] Released version 2.8-dev11 2023-05-11 05:33:21 +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
  - 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)