MINOR: list: define a watcher type
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Oct 2024 09:31:44 +0000 (11:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Dec 2024 12:57:48 +0000 (13:57 +0100)
commitb4501697a6321e990a94243c0274b4294dcbbd6b
tree8b886ae8b6320756de5789979fcd18e13c6109f9
parent41df9cac1f2092473347ee9c2f51739bf7ad0013
MINOR: list: define a watcher type

Define a new watcher type into list module. This type is similar to bref
and can be used to register an element which is currently tracking a
dynamic target. Contrary to bref, if the target is freed, every watcher
element are updated to point to a next valid entry or NULL.

This type will simplify handling of dynamic servers deletion, in
particular while stats dump are performed.

This patch is not a bug-fix. However, it is mandatory to fix a race
condition in dynamic servers. Thus, it should be backported along the
next commit up to 2.6.

(cherry picked from commit eafa8a32bb19ee567cb0a60a4042a8ef436e1e94)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/list-t.h
include/haproxy/list.h