BUG/MEDIUM: stream: use non-blocking freq_ctr calls from the stream dumper
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 17:23:23 +0000 (18:23 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 15:15:29 +0000 (16:15 +0100)
commitab36370f44f563fd29bba0d86d7fe3522b6e2abf
treed5867dde472f4e1b184ab707d7ac85e933be5ce7
parentac3df4c2370310d61b98ff6806ed06895131cd2a
BUG/MEDIUM: stream: use non-blocking freq_ctr calls from the stream dumper

The stream dump function is called from signal handlers (warning, show
threads, panic). It makes use of read_freq_ctr() which might possibly
block if it tries to access a locked freq_ctr in the process of being
updated, e.g. by the current thread.

Here we're relying on the non-blocking API instead. It may return incorrect
values (typically smaller ones after resetting the curr counter) but at
least it will not block.

This needs to be backported to stable versions along with the previous
commit below:

   MINOR: freq_ctr: provide non-blocking read functions

At least 3.1 is concerned as the warnings tend to increase the risk of
this situation appearing.

(cherry picked from commit 3c22fa315bcb2945d588cb64302f6ba5c89b382e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 124c6cdb13e0f7c03fb9232f429eb58f7d3c4742)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
src/stream.c