From: Christopher Faulet Date: Thu, 11 May 2023 07:11:57 +0000 (+0200) Subject: BUG/MEDIUM: filters: Don't deinit filters for disabled proxies during startup X-Git-Tag: v2.8-dev12~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fda8d2c8e0b4b84d474af79003537eef37d11ba;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: filters: Don't deinit filters for disabled proxies during startup During the startup stage, if a proxy was disabled in config, all filters were released and removed. But it may be an issue if some info are shared between filters of the same type. Resources may be released too early. It happens with ACLs defined in SPOE configurations. Pattern expressions can be shared between filters. To fix the issue, filters for disabled proxies are no longer released during the startup stage but only when HAProxy is stopped. This commit depends on the previous one ("MINOR: spoe: Don't stop disabled proxies"). Both must be backported to all stable versions. --- diff --git a/src/filters.c b/src/filters.c index a66cfba401..8910fc2684 100644 --- a/src/filters.c +++ b/src/filters.c @@ -308,10 +308,9 @@ flt_init_all() int err_code = ERR_NONE; for (px = proxies_list; px; px = px->next) { - if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) { - flt_deinit(px); + if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) continue; - } + err_code |= flt_init(px); if (err_code & (ERR_ABORT|ERR_FATAL)) { ha_alert("Failed to initialize filters for proxy '%s'.\n",