From: Amaury Denoyelle Date: Tue, 29 Sep 2026 14:39:17 +0000 (+0200) Subject: BUG/MINOR: mux_quic: account data in conn fctl on early detach X-Git-Tag: v3.5-dev9~178 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=9d2af5174bc8b01e3c4b7b7604d75873ff4bc0e3;p=haproxy.git BUG/MINOR: mux_quic: account data in conn fctl on early detach The previous patch accounts unconsumed data when QCS is freed before being remotely closed. The objective is to ensure to limit the inconsistency in conn flow control between client and server. In fact, this patch is incomplete as peer consumed level cannot be known before receiving its final size. Thus, discrepancies in connection flow control may still appear over time. The proper method is to delay QCS release until remote close is performed. However, this is a significant change which will be implemented in a future patch. This must be backported up to 2.8, after a period of observation --- diff --git a/src/mux_quic.c b/src/mux_quic.c index 403acbfcd..996904d14 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2670,6 +2670,19 @@ static void qcs_destroy(struct qcs *qcs) qcc_release_remote_stream(qcc, id); } + /* If some data are not yet consumed, account them in conn flow + * control. On frontend, this may happen when FE stream is released + * prior to request completion. + * + * TODO QCS should not be released if not closed remotely to guarantee + * the connection flow control consistency + */ + if (!qcs_is_close_remote(qcs) && qcs->rx.offset_max > qcs->rx.offset) { + COUNT_IF(1, "QCS is released while not remotely closed. " + "This may cause miscalculation in conn flow control."); + qcc_account_for_conn_fctl(qcc, qcs->rx.offset_max - qcs->rx.offset); + } + qcs_free(qcs); /* Rearm http-keep-alive timeout when last request stream is freed. */