]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: prepare feed_post_mortem_late
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 15 Jul 2024 12:56:24 +0000 (14:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Jul 2024 12:04:41 +0000 (14:04 +0200)
commit7cdf5751b5111bdcc582118de2e1e9f4cabfba41
tree977821da06d0b7dd08c1b347eb89bbc8b6b702c1
parente0e2b6613214212332de4cbad2fc06cf4774c1b0
MINOR: debug: prepare feed_post_mortem_late

Process runtime information could be very useful in post_mortem, but we have to
collect it just before calling run_poll_loop(). Like this we are sure, that
we've successfully applied all configuration parameters and what we've
collected are the latest runtime settings.

The most appropraite place to collect such information is
feed_post_mortem_late(). It's called in each thread, but puts thread info in
the post_mortem only when it's in the last thread context. As it's called
under mutex lock, other threads at this moment have to wait until
feed_post_mortem_late() and another initialization functions from
per_thread_init_list will finish. The number of threads could be large. So, to
avoid spending a lot of time under the lock, let's exit immediately from
feed_post_mortem_late(), if it wasn't called in the last thread.
src/debug.c