From: Amaury Denoyelle Date: Tue, 24 Feb 2026 16:05:37 +0000 (+0100) Subject: MINOR: promex: test applet resume in stress mode X-Git-Tag: v3.4-dev6~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00a106059eecf9a01b4d455314bdb59e792f1082;p=thirdparty%2Fhaproxy.git 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 --- 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;