From 00a106059eecf9a01b4d455314bdb59e792f1082 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 24 Feb 2026 17:05:37 +0100 Subject: [PATCH] MINOR: promex: test applet resume in stress mode Implement a stress mode with force yield for promex applet each time a metric is displayed. This is implemented by returning 0 in promex_dump_ts() each time the output buffer is not empty. To test this, haproxy must be compiled with DEBUG_STRESS and the following configuration must be used : global stress-level 1 --- addons/promex/service-prometheus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/promex/service-prometheus.c b/addons/promex/service-prometheus.c index 0cd5a6c0f..a09fa8730 100644 --- a/addons/promex/service-prometheus.c +++ b/addons/promex/service-prometheus.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -347,6 +348,10 @@ static int promex_dump_ts(struct appctx *appctx, struct ist prefix, istcat(&n, prefix, PROMEX_MAX_NAME_LEN); istcat(&n, name, PROMEX_MAX_NAME_LEN); + /* In stress mode, force yielding on each metric. */ + if (STRESS_RUN1(istlen(*out), 0)) + goto full; + if ((ctx->flags & PROMEX_FL_METRIC_HDR) && !promex_dump_ts_header(n, desc, type, out, max)) goto full;