From: Christopher Faulet Date: Tue, 3 Nov 2020 15:40:37 +0000 (+0100) Subject: BUG/MINOR: filters: Skip disabled proxies during startup only X-Git-Tag: v2.1.10~3 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=c3a82c6e3d476a5589e2c295d5b622d6c82f96d7;p=haproxy-2.1.git BUG/MINOR: filters: Skip disabled proxies during startup only This partially reverts the patch 400829cd2 ("BUG/MEDIUM: filters: Don't try to init filters for disabled proxies"). Disabled proxies must not be skipped in flt_deinit() and flt_deinit_all_per_thread() when HAProxy is stopped because, obvioulsy, at this step, all proxies appear as disabled (or stopped, it is the same state). It is safe to do so because, during startup, filters declared on disabled proxies are removed. Thus they don't exist anymore during shutdown. This patch must be backported in all versions where the patch above is. (cherry picked from commit 743bd6adc8a7657b324ac59376311d23d65bb4ed) Signed-off-by: Christopher Faulet (cherry picked from commit 59e7ab350d06542493d4da0467da8738c406dde8) Signed-off-by: Christopher Faulet --- diff --git a/src/filters.c b/src/filters.c index f900729..e6e78b0 100644 --- a/src/filters.c +++ b/src/filters.c @@ -359,7 +359,7 @@ flt_deinit(struct proxy *proxy) struct flt_conf *fconf, *back; list_for_each_entry_safe(fconf, back, &proxy->filter_configs, list) { - if (proxy->state != PR_STSTOPPED && fconf->ops->deinit) + if (fconf->ops->deinit) fconf->ops->deinit(proxy, fconf); LIST_DEL(&fconf->list); free(fconf); @@ -388,10 +388,8 @@ flt_deinit_all_per_thread() { struct proxy *px; - for (px = proxies_list; px; px = px->next) { - if (px->state != PR_STSTOPPED) - flt_deinit_per_thread(px); - } + for (px = proxies_list; px; px = px->next) + flt_deinit_per_thread(px); } /* Attaches a filter to a stream. Returns -1 if an error occurs, 0 otherwise. */