]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: pipe/thread: fix atomicity of pipe counters
authorWilly Tarreau <w@1wt.eu>
Thu, 30 Jan 2020 08:15:37 +0000 (09:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 30 Jan 2020 08:15:37 +0000 (09:15 +0100)
commit876b411f2bfbd883659855df19bb877d45522d07
treef0f63fb68080d3939a75233972010ca798c6134d
parent160287b6760584eb1dc20d9032d6d49ed051ca0b
BUG/MEDIUM: pipe/thread: fix atomicity of pipe counters

Previous patch 160287b676 ("MEDIUM: pipe/thread: maintain a per-thread
local cache of recently used pipes") didn't replace all pipe counter
updates with atomic ops since some were already under a lock, which is
obviously not a valid reason since these ones can be updated in parallel
to other atomic ops. The result was that the pipes_used could seldom be
seen as negative in the stats (harmless) but also this could result in
slightly more pipes being allocated than permitted, thus stealing a few
file descriptors that were not usable for connections anymore. Let's use
pure atomic ops everywhere these counters are updated.

No backport is needed.
src/pipe.c