DEBUG: pools: detect that malloc_trim() is in progress

Now when calling ha_panic() with a thread still under malloc_trim(),
we'll set a new tainted flag to easily report it, and the output
trace will report that this condition happened and will suggest to
use no-memory-trimming to avoid it in the future.
This commit is contained in:
Willy Tarreau
2023-10-25 15:42:27 +02:00
parent 26a6481f00
commit 96bb99a87d
4 changed files with 21 additions and 0 deletions

View File

@@ -251,6 +251,7 @@ enum tainted_flags {
TAINTED_PANIC = 0x00000200, /* a panic dump has started */
TAINTED_LUA_STUCK = 0x00000400, /* stuck in a Lua context */
TAINTED_LUA_STUCK_SHARED = 0x00000800, /* stuck in a shared Lua context */
TAINTED_MEM_TRIMMING_STUCK = 0x00001000, /* stuck while trimming memory */
};
/* this is a bit field made of TAINTED_*, and is declared in haproxy.c */