From: Christopher Faulet Date: Tue, 10 Nov 2026 15:10:40 +0000 (+0100) Subject: BUG/MEDIUM: mux-spop: do not enforce the timeout on connections with streams X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=3032c82335d1b3cd077f1dca1fd738ee218eca20;p=haproxy.git BUG/MEDIUM: mux-spop: do not enforce the timeout on connections with streams spop_conn_update_timeout() leaves the connection task unarmed while stream connectors are attached, since the timeouts are then enforced by the upper layer. But spop_attach() does not touch the task, so a connection which got a timeout while it had no stream, for instance because of pending output data or because of the default timeout applied to connections without stream, keeps it once a new stream is attached. When it strikes, spop_timeout_task() kills the connection and aborts the streams attached to it, while nothing indicates that the agent is not responding. As done for the H2 mux by commit c2ea47fb1 ("BUG/MEDIUM: mux-h2: do not enforce timeout on long connections") and for the FCGI mux by commit 6e3bad2f3 ("BUG/MEDIUM: mux-fcgi: do not enforce the timeout on connections with streams"), spop_timeout_task() now does not kill the connection when stream connectors are still attached, it only disarms the timeout. This should be backported to 3.1. --- diff --git a/src/mux_spop.c b/src/mux_spop.c index 7d228b2bb..dc6b439e1 100644 --- a/src/mux_spop.c +++ b/src/mux_spop.c @@ -2792,6 +2792,16 @@ static struct task *spop_timeout_task(struct task *t, void *context, unsigned in return t; } + if (!spop_conn_may_expire(spop_conn)) { + /* streams are still attached, they may be waiting for + * the agent, so the timeout is not ours to enforce. + */ + HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock); + t->expire = TICK_ETERNITY; + TRACE_DEVEL("leaving (streams attached)", SPOP_EV_SPOP_CONN_WAKE, spop_conn->conn); + return t; + } + /* We're about to destroy the connection, so make sure nobody attempts * to steal it from us. */