]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: task: close a tiny race in the inter-thread wakeup
authorWilly Tarreau <w@1wt.eu>
Mon, 4 Feb 2019 09:26:53 +0000 (10:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Feb 2019 13:21:35 +0000 (14:21 +0100)
commit155acffc13d4972f5642a84f5040eec4e9203c11
tree823a87e111cd4231343158f6d88662cf97896423
parentef6fd85623ba0137593e60d30cba40c7489d9231
BUG/MINOR: task: close a tiny race in the inter-thread wakeup

__task_wakeup() takes care of a small race that exists between threads,
but it uses a store barrier that is not sufficient since apparently the
state read after clearing the leaf_p pointer sometimes is incorrect. This
results in missed wakeups between threads competing at a high rate. Let's
use a full barrier instead to serialize the operations.

This may be backported to 1.9 though it's extremely unlikely that this
bug will ever manifest itself there.
src/task.c