]> git.kaiwu.me - haproxy.git/commit
MINOR: muxes: enforce thread-safety for private idle conns
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 18 Aug 2025 13:24:05 +0000 (15:24 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 12:55:21 +0000 (14:55 +0200)
commit9574867358ce0eaa17096c88599c29a8767b7897
treeb9d984cc2a1033f26f7109898fc965d609bc9ff3
parentb18b5e2f742b717d45ed0188c35e0ad7051e6a20
MINOR: muxes: enforce thread-safety for private idle conns

When a backend connnection becomes idle, muxes must activate some
protection to mark future access on it as dangerous. Indeed, once a
connection is inserted in an idle list, it may be manipulated by another
thread, either via takeover or scheduled for purging.

Private idle connections are stored into a session instead of the server
tree. They are never subject to a takeover for reuse or purge mechanism.
As such, currently they do not require the same level of protection.

However, a new patch will introduce support for private idle connections
purging. Thus, the purpose of this patch is to ensure protection is
activated as well now.

TASK_F_USR1 was already set on them as an anticipation for such need.
Only some extra operations were missing, most notably xprt_set_idle()
invokation. Also, return path of muxes detach operation is adjusted to
ensure such connection are never accessed after insertion.
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mux_spop.c