haproxy public development tree
Go to file
Aurelien DARRAGON da9503ca9a MEDIUM: hlua: reliable timeout detection
For non yieldable lua handlers (converters, fetches or yield
incompatible lua functions), current timeout detection relies on now_ms
thread local variable.

But within non-yieldable contexts, now_ms won't be updated if not by us
(because we're momentarily stuck in lua context so we won't
re-enter the polling loop, which is responsible for clock updates).

To circumvent this, clock_update_date(0, 1) was manually performed right
before now_ms is being read for the timeout checks.

But this fails to work consistently, because if no other concurrent
threads periodically run clock_update_global_date(), which do happen if
we're the only active thread (nbthread=1 or low traffic), our
clock_update_date() call won't reliably update our local now_ms variable

Moreover, clock_update_date() is not the right tool for this anyway, as
it was initially meant to be used from the polling context.
Using it could have negative impact on other threads relying on now_ms
to be stable. (because clock_update_date() performs global clock update
from time to time)

-> Introducing hlua multipurpose timer, which is internally based on
now_cpu_time_fast() that provides per-thread consistent clock readings.

Thanks to this new hlua timer API, hlua timeout logic is less error-prone
and more robust.

This allows the timeout detection to work as expected for both yieldable
and non-yieldable lua handlers.

This patch depends on commit "MINOR: clock: add now_cpu_time_fast() function"

While this could theorically be backported to all stable versions,
it is advisable to avoid backports unless we're confident enough
since it could cause slight behavior changes (timing related) in
existing setups.
2023-04-19 11:03:31 +02:00
.github CI: enable monthly test on Fedora Rawhide 2023-04-14 10:05:32 +02:00
addons CLEANUP: opentracing: remove the last two occurrences of strncat() 2023-04-07 18:14:28 +02:00
admin BUILD: halog: fix missing double-quote at end of help line 2022-11-25 11:11:41 +01:00
dev MEDIUM: ring: make the offset relative to the head/tail instead of absolute 2023-02-24 09:26:30 +01:00
doc MEDIUM: config: set useful ALPN defaults for HTTPS and QUIC 2023-04-19 09:52:20 +02:00
examples EXAMPLES: add basic event_hdl lua example script 2023-04-05 09:02:14 +02:00
include MEDIUM: hlua: reliable timeout detection 2023-04-19 11:03:31 +02:00
reg-tests MEDIUM: config: set useful ALPN defaults for HTTPS and QUIC 2023-04-19 09:52:20 +02:00
scripts SCRIPTS: run-regtests: add a version check 2022-11-30 18:44:33 +01:00
src MEDIUM: hlua: reliable timeout detection 2023-04-19 11:03:31 +02:00
tests
.cirrus.yml CI: cirrus-ci: bump FreeBSD image to 13-1 2022-09-09 13:30:17 +02:00
.gitattributes
.gitignore CLEANUP: exclude udp-perturb with .gitignore 2022-09-16 15:47:04 +02:00
.mailmap
.travis.yml
BRANCHES
CHANGELOG [RELEASE] Released version 2.8-dev7 2023-04-08 17:38:39 +02:00
CONTRIBUTING
INSTALL MINOR: version: mention that it's development again 2022-12-01 15:24:10 +01:00
LICENSE
MAINTAINERS CLEANUP: assorted typo fixes in the code and comments 2022-11-30 14:02:36 +01:00
Makefile MINOR: quic: Add a fake congestion control algorithm named "nocc" 2023-03-31 17:09:03 +02:00
README
SUBVERS
VERDATE [RELEASE] Released version 2.8-dev7 2023-04-08 17:38:39 +02:00
VERSION [RELEASE] Released version 2.8-dev7 2023-04-08 17:38:39 +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)