]> git.kaiwu.me - haproxy.git/commit
MEDIUM: threads: always abort when calling thread_isolated() under a lock
authorWilly Tarreau <w@1wt.eu>
Tue, 25 Aug 2026 16:21:36 +0000 (18:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Aug 2026 16:40:15 +0000 (18:40 +0200)
commit8e2fff8b39ff5bf271f64868ecc548ef7a3a5c69
tree2a42a82e2b4cbf5def8deaffc127f7a2fcd0d6a3
parentd7ad27e4e48e4b28b06e415f12e5330fd12b720d
MEDIUM: threads: always abort when calling thread_isolated() under a lock

A bug was found in _sink_forward_io_handler() where we call
ring_dispatch_messages() under an unneeded look, and that one calls
thread_isolate() on first call. Needless to say that when we're unlucky
it really deadlocks.

There is never ever any valid case for calling thread_isolate() with a
lock held, and all such instances MUST be addressed. In addition we must
not call it under isolation either. Let's just add two BUG_ON() for this
that display exactly the problem so that next time a developer creates
such an accidental construct, it's instantly discovered.

All tests pass, but better not backport this, as it's essentially meant
to help developers, it would not bring any benefit to end users (the
watchdog just addresses this case as well one second later if this
happens).
src/thread.c