MINOR: list: define a watcher type
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Oct 2024 09:31:44 +0000 (11:31 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Jan 2025 09:18:17 +0000 (10:18 +0100)
commit28bc2fe572f08602f38b5dd98806376871bb72ca
treed43259cfff3e488fba546fe4edbd3694ff7bbc88
parenteda4a62fc10a118577a6bba2270e9d808f73feb9
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>
(cherry picked from commit b4501697a6321e990a94243c0274b4294dcbbd6b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/list-t.h
include/haproxy/list.h