BUG/MEDIUM: cli: make "show fd" thread-safe
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Aug 2018 09:05:48 +0000 (11:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Aug 2018 15:51:49 +0000 (17:51 +0200)
commitbf9fd650883b23604b7cd4aabf04fc0c4c8fe7c7
tree37cf7f53abca75e5e1ec2883123da6c1e2364d14
parent60b639ccbe919b86790267d7e45a39b75434acbe
BUG/MEDIUM: cli: make "show fd" thread-safe

The "show fd" command was implemented as a debugging aid but it's not
thread safe. Its features have grown, it can now dump some mux-specific
parts and is being used in production to capture some useful debugging
traces. But it will quickly crash the process when used during an H2 load
test for example, especially when haproxy is built with the DEBUG_UAF
option. It cannot afford not to be thread safe anymore. Let's make use
of the new rendez-vous point using thread_isolate() / thread_release()
to ensure that the data being dumped are not changing under us. The dump
becomes slightly slower under load but now it's safe.

This should be backported to 1.8 along with the rendez-vous point code
once considered stable enough.
src/cli.c