From: William Lallemand Date: Tue, 3 Aug 2021 11:18:11 +0000 (+0200) Subject: MINOR: stats: shows proxy in a stopped state X-Git-Tag: v2.5-dev4~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85a16b2ba22102eb216f7c39ae09be2de9f81a47;p=thirdparty%2Fhaproxy.git MINOR: stats: shows proxy in a stopped state Previous patch b5c0d65 ("MINOR: proxy: disabled takes a stopping and a disabled state") allows us to set 2 states for a stopped or a disabled proxy. With this patch we are now able to show the stats of all proxies when the process is in a stopping states, not only when there is some activity on a proxy. This patch should fix issue #1307. --- diff --git a/src/stats.c b/src/stats.c index 71e81c7fa2..b767ce5d46 100644 --- a/src/stats.c +++ b/src/stats.c @@ -3617,10 +3617,10 @@ static int stats_dump_proxies(struct stream_interface *si, px = appctx->ctx.stats.obj1; /* Skip the global frontend proxies and non-networked ones. - * Also skip disabled proxies unless they are still holding active sessions. + * Also skip proxies that were disabled in the configuration * This change allows retrieving stats from "old" proxies after a reload. */ - if ((!px->disabled || px->served > 0) && px->uuid > 0 && + if (!(px->disabled & PR_DISABLED) && px->uuid > 0 && (px->cap & (PR_CAP_FE | PR_CAP_BE)) && !(px->cap & PR_CAP_INT)) { if (stats_dump_proxy_to_buffer(si, htx, px, uri) == 0) return 0;