haproxy public development tree
Go to file
Willy Tarreau 274ba67862 BUG/MAJOR: lb/threads: fix AB/BA locking issue in round-robin LB
An occasional divide by zero in the round-robin scheduler was addressed
in commit 9df86f997 ("BUG/MAJOR: lb/threads: fix insufficient locking on
round-robin LB") by grabing the server's lock in fwrr_get_server_from_group().

But it happens that this is not the correct approach as it introduces a
case of AB/BA deadlock reported by Maksim Kupriianov. This happens when
a server weight changes from/to zero while another thread extracts this
server from the tree. The reason is that the functions used to manipulate
the state work under the server's lock and grab the LB lock while the ones
used in LB work under the LB lock and grab the server's lock when needed.

This commit mostly reverts the changes above and instead further completes
the locking analysis performed on this code to identify areas that really
need to be protected by the server's lock, since this is the only algorithm
which happens to have this requirement. This audit showed that in fact all
locations which require the server's lock are already protected by the LB
lock. This was not noticed the first time due to the server's lock being
taken instead and due to some functions misleadingly using atomic ops to
modify server fields which are under the LB lock protection (these ones
were now removed).

The change consists in not taking the server's lock anymore here, and
instead making sure that the aforementioned function which used to
suffer from the server's weight becoming zero only uses a copy of the
weight which was preliminary verified to be non-null (when the weight
is null, the server will be removed from the tree anyway so there is
no need to recalculate its position).

With this change, the code survived an injection at 200k req/s split
on two servers with weights changing 50 times a second.

This commit must be backported to 1.9 only.
2019-04-24 14:23:40 +02:00
.github/ISSUE_TEMPLATE DOC: add github issue templates 2019-01-17 22:53:55 +01:00
contrib MINOR: contrib: dummy wurfl library 2019-04-23 11:00:23 +02:00
doc MINOR: action: new '(http-request|tcp-request content) do-resolve' action 2019-04-23 11:41:52 +02:00
ebtree CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
examples CLEANUP: wurfl: removed deprecated methods 2019-04-23 11:00:23 +02:00
include MINOR: action: new '(http-request|tcp-request content) do-resolve' action 2019-04-23 11:41:52 +02:00
reg-tests REGTEST: adapt some reg tests after renaming. 2019-04-23 15:37:11 +02:00
scripts REGTEST: make the "run-regtests" script search for tests in reg-tests by default 2019-04-23 16:09:50 +02:00
src BUG/MAJOR: lb/threads: fix AB/BA locking issue in round-robin LB 2019-04-24 14:23:40 +02:00
tests CLEANUP: fix a misspell in tests/filltab25.c 2018-11-18 22:23:15 +01:00
.gitignore DOC: split the README into README + INSTALL 2018-12-16 22:30:57 +01:00
.travis.yml MEDIUM: enable travis-ci builds 2019-04-18 18:39:55 +02:00
CHANGELOG [RELEASE] Released version 2.0-dev2 2019-03-26 05:40:51 +01:00
CONTRIBUTING
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 REGTEST: replace LEVEL option by a more human readable one. 2019-04-23 15:14:52 +02:00
README DOC: split the README into README + INSTALL 2018-12-16 22:30:57 +01:00
ROADMAP
SUBVERS
VERDATE [RELEASE] Released version 2.0-dev2 2019-03-26 05:40:51 +01:00
VERSION [RELEASE] Released version 2.0-dev2 2019-03-26 05:40:51 +01:00

README

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)