]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: shows proxy in a stopped state
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 3 Aug 2021 11:18:11 +0000 (13:18 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 3 Aug 2021 12:17:45 +0000 (14:17 +0200)
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.

src/stats.c

index 71e81c7fa20f7be98f2b4f68b8d08e52d51a3b6f..b767ce5d4673ee5ba1e710a750850c2f6e5b094c 100644 (file)
@@ -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;