From aad6aebf748b472f9b52a30ebdf644ac7c79e1d5 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 19 Nov 2026 10:53:50 +0100 Subject: [PATCH] BUG/MEDIUM: xprt_qmux: apply the configured bidi streams limit on FE QMux frontends always advertise 100 bidirectional streams, ignoring "tune.quic.fe.stream.max-concurrent" and "tune.quic.fe.stream.max-total" which QUIC applies in quic_transport_params_init(). The MUX however relies on the client never being allowed to open more than stream.max-total streams: with a value below 100, releasing the first remote stream hits BUG_ON(qcc->lfctl.ms_bidi > max) in qcc_release_remote_stream(), so the process dies on the first completed request on a "proto qmux" frontend. Let's compute the frontend limit as QUIC does. The h3_clr QMux reg-test now sets stream.max-total to cover this. This was introduced in 3.4 by commit 497cabd9e ("MEDIUM: quic: implement fe.stream.max-total"), which did not apply to the QMux transport parameters. It must be backported to 3.4. --- reg-tests/qmux/h3_clr.vtc | 2 ++ src/xprt_qmux.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/reg-tests/qmux/h3_clr.vtc b/reg-tests/qmux/h3_clr.vtc index 364e180bd..1edcb096e 100644 --- a/reg-tests/qmux/h3_clr.vtc +++ b/reg-tests/qmux/h3_clr.vtc @@ -11,6 +11,8 @@ haproxy h1 -conf { thread-groups 1 .endif expose-experimental-directives + # below the default streams limit + tune.quic.fe.stream.max-total 10 defaults mode http diff --git a/src/xprt_qmux.c b/src/xprt_qmux.c index 4c29fad1f..83d124eea 100644 --- a/src/xprt_qmux.c +++ b/src/xprt_qmux.c @@ -11,6 +11,7 @@ #include #include #include +#include /* Default protocol when not running over SSL layer. */ #define XPRT_QMUX_DEFAULT_ALPN "h3" @@ -302,7 +303,11 @@ static int xprt_qmux_init(struct connection *conn, void **xprt_ctx) /* TP configuration advertised by us */ ctx->lparams.max_idle_timeout = 30; ctx->lparams.initial_max_data = 1638400; - ctx->lparams.initial_max_streams_bidi = 100; + /* FE limit computed as in quic_transport_params_init() */ + ctx->lparams.initial_max_streams_bidi = conn_is_back(conn) ? 100 : + quic_tune.fe.stream_max_total ? + MIN(quic_tune.fe.stream_max_concurrent, quic_tune.fe.stream_max_total) : + quic_tune.fe.stream_max_concurrent; ctx->lparams.initial_max_streams_uni = 3; ctx->lparams.initial_max_stream_data_bidi_local = qcm_stream_rx_bufsz(); ctx->lparams.initial_max_stream_data_bidi_remote = qcm_stream_rx_bufsz(); -- 2.47.3