From 4bcfc09acf26fc74f422766163629008fbae8683 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 10 Feb 2026 11:18:11 +0100 Subject: [PATCH] MINOR: proxy: define proxy watcher member Define a new member watcher_list in proxy. It will be used to register modules which iterate over the proxies list. This will ensure that the operation is safe even if a backend is removed in parallel. --- include/haproxy/proxy-t.h | 1 + src/proxy.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index 2c85761bf..fcf9732bd 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -507,6 +507,7 @@ struct proxy { struct list filter_configs; /* list of the filters that are declared on this proxy */ struct guid_node guid; /* GUID global tree node */ + struct mt_list watcher_list; /* list of elems which currently references this proxy instance (currently only used with backends) */ EXTRA_COUNTERS(extra_counters_fe); EXTRA_COUNTERS(extra_counters_be); diff --git a/src/proxy.c b/src/proxy.c index 5bed1ae95..f9241ea1d 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1580,6 +1580,7 @@ void init_new_proxy(struct proxy *p) p->stream_new_from_sc = stream_new; guid_init(&p->guid); + MT_LIST_INIT(&p->watcher_list); p->extra_counters_fe = NULL; p->extra_counters_be = NULL;