MINOR: debug: write panic dump to stderr one thread at a time
authorWilly Tarreau <w@1wt.eu>
Thu, 4 May 2023 16:52:51 +0000 (18:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 May 2023 17:15:50 +0000 (19:15 +0200)
commit880d1684a73915fd2663fefad9c8c300deab3be8
tree62b62bf17dd3c5ecdc6f9fa7dc9741bf2ff12e21
parent9a6ecbd590bea6051bcc95788701117c79f506dc
MINOR: debug: write panic dump to stderr one thread at a time

Currently large setups cannot dump all their threads because they're
first dumped to the trash buffer, then copied to stderr. Here we can
now change this, instead we dump one thread at a time into the trash
and immediately send it to stderr. We also keep a copy into a local
trash chunk that's assigned to thread_dump_buffer so that a core file
still contains a copy of a large number of threads, which is generally
sufficient for the vast majority of situations.

It was verified that dumping 256 threads now produces ~55kB of output
and all of them are properly dumped.
src/debug.c