From: Amaury Denoyelle Date: Wed, 28 Oct 2026 09:38:29 +0000 (+0100) Subject: BUG/MEDIUM: mux_quic: do not reset timeout after shut X-Git-Tag: v3.5-dev10~22 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=c0b3d56eff7a87dee22e966cfe67f35204d71e36;p=haproxy.git BUG/MEDIUM: mux_quic: do not reset timeout after shut When a connection is shutting down, MUX QUIC uses shut-timeout if defined as a final timeout value. However, the timer was reset every time qcc_refresh_timeout() was called. In effect, a connection could stay indefinitely due to repeated activity from the peer. Fix this by ensuring shut-timeout is only set once in qcc_refresh_timeout(). The value is not updated if QCC task timeout is already set. Note that shut-timeout could be completely ignored if set to a greater value than the default client/server timeout. However, as the docs imply, this is not expected, as it is used to ensure a closing connection will quickly end. This must be backported up to 2.8. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index bf538b3cb..67a909852 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -373,9 +373,13 @@ static void qcc_refresh_timeout(struct qcc *qcc) qcc->task->expire = tick_add_ifset(now_ms, qcc->timeout); } else if (qcc->app_st >= QCC_APP_ST_SHUT) { + /* Schedule shut-timeout once and do not reset it after. It is + * expected that if set this value is shorter than the default + * timeout, so that the connection will quickly end. + */ TRACE_DEVEL("connection in closing", QMUX_EV_QCC_WAKE, qcc->conn); - qcc->task->expire = tick_add_ifset(now_ms, - qcc->shut_timeout); + qcc->task->expire = tick_first(qcc->task->expire, + tick_add_ifset(now_ms, qcc->shut_timeout)); } else if (!conn_is_back(qcc->conn)) { if (!LIST_ISEMPTY(&qcc->opening_list) || unlikely(!qcc->largest_bidi_r)) {