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 <noreply@anthropic.com>
Signed-off-by: Aleksandar Lazic <al-haproxy@none.at>