]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: add a function to dump a stuck thread
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 10:20:45 +0000 (11:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 17:35:42 +0000 (18:35 +0100)
commit0950778b3a13fe31ff83223827d6692076cba5e5
tree6c1a793fcd91a55af92765158a67ff1f9fd45362
parent3f4d646849a253f3dc15972e40023495725efe98
MINOR: debug: add a function to dump a stuck thread

There's currently no way to just emit a warning informing that a thread
is stuck without crashing. This is a problem because sometimes users
would benefit from this info to clean up their configuration (e.g. abuse
of map_regm, lua-load etc).

This commit adds a new function ha_stuck_warning() that will emit a
warning indicating that the designated thread has been stuck for XX
milliseconds, with a number of streams blocked, and will make that
thread dump its own state. The warning will then be sent to stderr,
along with some reminders about the impacts of such situations to
encourage users to fix their configuration.

In order not to disrupt operations, a local 4kB buffer is allocated
in the stack. This should be quite sufficient.

For now the function is not used.
include/haproxy/debug.h
src/debug.c