]> git.kaiwu.me - haproxy.git/commit
OPTIMIZE: stream: Stop holding a reference on the frontend during stream_free()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 15 Oct 2026 09:30:59 +0000 (11:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Oct 2026 17:07:18 +0000 (19:07 +0200)
commitc2eef4f4b31f8b6fed4c44980b0c4ec4b936e803
treeb1c7738529fa51419f95d5429b23ba04d60559f7
parent853b5c1a6aaeef2fcec0fcf9476a763714176e81
OPTIMIZE: stream: Stop holding a reference on the frontend during stream_free()

Holding a reference on the frontend during the whole stream teardown has a
performance impact: all the streams of a frontend atomically increment and
decrement the same counter.

Instead, the frontend capture pools are flushed before the stream connectors
teardown and the remaining pools after it, depending on a flush_pools
flag. That way the frontend is no longer dereferenced after sc_destroy().

Must be backported with the SPOE fix b5db88d9c ("spoe: Let an agent outlive
its applets during a backend deletion"), as far as 3.3.
src/stream.c