DEBUG: wdt: better detect apparently locked up threads and warn about them
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 10:21:45 +0000 (11:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 18:04:38 +0000 (19:04 +0100)
commita44922fb10e73758c5cc08142a2fba31e86cee83
treef0a43f6e60d49ac24808f9c7ddcf9be95af4f54b
parent80ea59459c84ff0591d100a621243558a6d6a682
DEBUG: wdt: better detect apparently locked up threads and warn about them

In order to help users detect when threads are behaving abnormally, let's
try to emit a warning when one is no longer making any progress. This will
allow to catch faulty situations more accurately, instead of occasionally
triggering just after the long task. It will also let users know that there
is something wrong with their configuration, and inspect the call trace to
figure whether they're using excessively long rules or Lua for example (the
usual warnings about lua-load vs lua-load-per-thread are still reported).

The warning will only be emitted for threads not yet marked as stuck so
as not to interfere with panic dumps and avoid sending a warning just
before a panic. A tainted flag is set when this happens however (0x2000).

(cherry picked from commit 148eb5875fb7e6c46c0a9eac486dcb7b3bca931d)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/bug.h
src/debug.c
src/wdt.c