From: Aleksandar Lazic Date: Tue, 20 Oct 2026 18:42:11 +0000 (+0200) Subject: BUG/MINOR: promex: don't loop forever when a module skips a time series X-Git-Tag: v3.5-dev10~72 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=c4dff2b36cc3a34564e8484ea1a52e1f88726b3f;p=haproxy.git BUG/MINOR: promex: don't loop forever when a module skips a time series The fill_ts() callback of a promex module may return 0 to skip the current time series. In this case, promex_dump_module_metrics() jumps back to the beginning of the loop on the time series with "continue", without calling next_ts(). So fill_ts() is called again for the same time series, forever, until the watchdog kills the process. The "next" label, which retrieves the next time series, was obviously meant to be used there, but it is never reached by a jump. The modules of HAProxy itself never skip a time series with a valid configuration (the stick-table module only skips the tables with a null size), but an external module doing so triggers the issue at the first scrape of its metrics. The issue was introduced by commit 5f875414e ("MEDIUM: promex: Dump metrics of registered modules with a way to filter them"). This patch must be backported as far as 3.0. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Aleksandar Lazic --- diff --git a/addons/promex/service-prometheus.c b/addons/promex/service-prometheus.c index 4de3ec8e3..fd9a81467 100644 --- a/addons/promex/service-prometheus.c +++ b/addons/promex/service-prometheus.c @@ -1586,7 +1586,7 @@ static int promex_dump_module_metrics(struct appctx *appctx, struct promex_modul ret = mod->fill_ts(ctx->p[1], ctx->p[2], ctx->mod_field_num, labels, &val); if (!ret) - continue; + goto next; if (ret < 0) goto error;