From: Olivier Houchard Date: Wed, 18 Nov 2026 16:52:44 +0000 (+0100) Subject: BUG/MEDIUM: quic: never advertise more streams than configured X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=b8b7c5540225e71f089e27591672f050c852291e;p=haproxy.git BUG/MEDIUM: quic: never advertise more streams than configured With "tune.streams-elasticity", the initial max-streams-bidi transport parameter is set to conn_calc_max_streams() of the configured limit, i.e. the lowest of "tune.quic.fe.stream.max-concurrent" and "tune.quic.fe.stream.max-total". But this function may return more than the value it is passed, as it also considers the share of the extra streams budget left for each remaining connection, which does not depend on it: with "tune.streams-elasticity 1000", it returns 10 at low load. When "tune.quic.fe.stream.max-total" is lower than this, 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. Let's not advertise more than the configured limit. The stream_max_total reg-test now enables stream elasticity to cover this. This was introduced by commit d21ec4c70 ("MINOR: quic: use stream elasticity value for initial advertisement") in 3.4-dev13 and must be backported to 3.4. --- diff --git a/reg-tests/quic/stream_max_total.vtc b/reg-tests/quic/stream_max_total.vtc index 1b7c1dd87..c86f55ba2 100644 --- a/reg-tests/quic/stream_max_total.vtc +++ b/reg-tests/quic/stream_max_total.vtc @@ -7,6 +7,8 @@ feature cmd "$HAPROXY_PROGRAM -cc 'feature(QUIC) && !feature(QUIC_OPENSSL_COMPAT haproxy ha_qsrv -conf { global tune.quic.fe.stream.max-total 3 + # must not grant more streams than max-total + tune.streams-elasticity 1000 defaults mode http diff --git a/src/quic_tp.c b/src/quic_tp.c index 1b6d1015f..0f3b5fcb2 100644 --- a/src/quic_tp.c +++ b/src/quic_tp.c @@ -879,7 +879,8 @@ int qc_lstnr_params_init(struct quic_conn *qc, */ if (global.tune.streams_elasticity && !qc->li->bind_conf->ssl_conf.early_data) { rx_params->initial_max_streams_bidi = - conn_calc_max_streams(rx_params->initial_max_streams_bidi); + MIN(rx_params->initial_max_streams_bidi, + conn_calc_max_streams(rx_params->initial_max_streams_bidi)); } return 1;