]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: fd/threads: properly lock the FD before adding it to the fd cache.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 8 Feb 2018 16:03:33 +0000 (16:03 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Feb 2018 16:24:06 +0000 (17:24 +0100)
commit1ff9104117c67c99130c3b141d8fc236b3aa22a7
treec702d8aa8cefdf6548c51df5c40da5bed46d258b
parent58aa5ccd7675e5c960b045e96fdf69845d6449b4
BUG/MINOR: fd/threads: properly lock the FD before adding it to the fd cache.

It was believed that it was useless to lock the "prev" field when adding a
FD. However, if there's only one element in the FD cache, and that element
removes itself from the fd cache, and another FD is added before the first
add completed, there's a risk of losing elements. To prevent that, lock the
"prev" field, so that such a removal will wait until the add completed.
src/fd.c