BUG/MEDIUM: lb/threads: always properly lock LB algorithms on maintenance operations
authorWilly Tarreau <w@1wt.eu>
Tue, 21 Aug 2018 17:44:53 +0000 (19:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Aug 2018 17:44:53 +0000 (19:44 +0200)
commit1b87748ff5fe98f230f9cde2a754243d1da4202e
tree1c2c07f0c04e844e4dc7aacb17409448b70a6707
parent1b13bfd646e00ccfafd4727febb2589366733064
BUG/MEDIUM: lb/threads: always properly lock LB algorithms on maintenance operations

Since commit 3ff577e ("MAJOR: server: make server state changes
synchronous again"), srv_update_status() calls the various maintenance
operations of the LB algorithms (->set_server_up, ->set_server_down,
->update_server_weight()). These ones are called with a single thread
guaranteed by the rendez-vous point, so the fact that they're lacking
some locks has no effect. However we'll need to remove the rendez-vous
point so we have to take care of properly locking all the LB algos.

The comments have been properly updated on the various functions to
mention their locking expectations. All these functions are called
with the server lock held, and all of them now support concurrent
calls by using the lbprm's lock.

This fix doesn't need to be backported at the moment, though if any
check-specific issue surfaced in 1.8, it could make sense to reuse it.
src/lb_chash.c
src/lb_fas.c
src/lb_fwlc.c
src/lb_fwrr.c
src/lb_map.c