]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: make ha_stuck_warning() print the whole message at once
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 06:59:45 +0000 (08:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 14:25:47 +0000 (16:25 +0200)
commit513397ac8215cdc1c0ab077a4a6809d7bd32f262
tree29f470afa9bcaeb8d211665ab7423400243e503b
parentc16d5415a807f5a46d34ee6aac4c35fd42dac0c0
MINOR: debug: make ha_stuck_warning() print the whole message at once

It has been noticed quite a few times during troubleshooting and even
testing that warnings can happen in avalanches from multiple threads
at the same time, and that their reporting it interleaved bacause the
output is produced in small chunks. Originally, this code inspired by
the panic code aimed at making sure to log whatever could be emitted
in case it would crash later. But this approach was wrong since writes
are atomic, and performing 5 writes in sequence in each dumping thread
also means that the outputs can be mixed up at 5 different locations
between multiple threads. The output of warnings is never very long,
and the stack-based buffer is 4kB so let's just concatenate everything
in the buffer and emit it at once using a single write(). Now there's
no longer this confusion on the output.
src/debug.c