haproxy/include
Christopher Faulet fa5c812a6b BUG/MINOR: buffers: Fix b_alloc_margin to be "fonctionnaly" thread-safe
b_alloc_margin is, strickly speeking, thread-safe. It will not crash
HAproxy. But its contract is not respected anymore in a multithreaded
environment. In this function, we need to be sure to have <margin> buffers
available in the pool after the allocation. So to have this guarantee, we must
lock the memory pool during all the operation. This also means, we must call
internal and lockless memory functions (prefixed with '__').

For the record, this patch fixes a pernicious bug happens after a soft reload
where some streams can be blocked infinitly, waiting for a buffer in the
buffer_wq list. This happens because, during a soft reload, pool_gc2 is called,
making some calls to b_alloc_fast fail.

This is specific to threads, no backport is needed.
2017-11-13 11:42:48 +01:00
..
common BUG/MINOR: buffers: Fix b_alloc_margin to be "fonctionnaly" thread-safe 2017-11-13 11:42:48 +01:00
import MINOR: threads: Add atomic-ops and plock includes in import dir 2017-10-31 11:36:13 +01:00
proto MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00
types MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00