]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: xprt_qmux: apply the configured bidi streams limit on FE master
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 19 Nov 2026 09:53:50 +0000 (10:53 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 19 Nov 2026 17:36:52 +0000 (18:36 +0100)
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
src/xprt_qmux.c

index 364e180bdc9dd1f1260ed56a695ca64491b5fdca..1edcb096ed1a432624514d2a9bbc09d8a2bc1b5f 100644 (file)
@@ -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
index 4c29fad1f98e91bf881e5602cd4d73b2a517ea84..83d124eeaf1f59e2b6e34e39cca905d5c93fc5e1 100644 (file)
@@ -11,6 +11,7 @@
 #include <haproxy/qcm_qmux.h>
 #include <haproxy/quic_frame.h>
 #include <haproxy/quic_tp-t.h>
+#include <haproxy/quic_tune.h>
 
 /* 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();