From ba29687bc196e0eb1c1752181e3d49a10a631887 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 16 Oct 2020 15:10:11 +0200 Subject: [PATCH] BUG/MEDIUM: proxy: properly stop backends The proxy stopping mechanism was changed with commit 322b9b94e ("MEDIUM: proxy: make stop_proxy() now use stop_listener()") so that it's now entirely driven by the listeners. One thing was forgotten though, which is that pure backends will not stop anymore since they don't have any listener, and that it's necessary to stop them in order to stop the health checks. No backport is needed. --- src/proxy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/proxy.c b/src/proxy.c index 43c2362285..790d4d0802 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1315,6 +1315,11 @@ void stop_proxy(struct proxy *p) list_for_each_entry(l, &p->conf.listeners, by_fe) stop_listener(l, 1, 0, 0); + if (!p->disabled && !p->li_ready) { + /* might be just a backend */ + p->disabled = 1; + } + HA_SPIN_UNLOCK(PROXY_LOCK, &p->lock); } -- 2.39.5