]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: cli: make "show sess" really thread-safe
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Jan 2019 16:42:57 +0000 (17:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Jan 2019 17:06:49 +0000 (18:06 +0100)
commite6e52366c185db13ccaf0d2d669909c157d55923
tree1ca25858d5541a36ca42aa3bbda9bd9c805340d7
parentf1b11e2d16ae3edd53df1492a17d9ef07322788f
BUG/MEDIUM: cli: make "show sess" really thread-safe

This one used to rely on a few spin locks around lists manipulations
only but 1) there were still a few races (e.g. when aborting, or
between STAT_ST_INIT and STAT_ST_LIST), and 2) after last commit
which dumps htx info it became obvious that dereferencing the buffer
contents is not safe at all.

This patch uses the thread isolation from the rendez-vous point
instead, to guarantee that nothing moves during the dump. It may
make the dump a bit slower but it will be 100% safe.

This fix must be backported to 1.9, and possibly to 1.8 which likely
suffers from the short races above, eventhough they're extremely
hard to trigger.
src/stream.c