]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: mux-quic: cap elastic MAX_STREAMS to stream.max-total
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 18 Nov 2026 16:41:03 +0000 (17:41 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 18 Nov 2026 16:41:42 +0000 (17:41 +0100)
With "tune.streams-elasticity", qcc_release_remote_stream() grants as
MAX_STREAMS increment the difference between the elastic limit and the
streams still usable by the peer. Unlike the static path, nothing caps
the new limit to "tune.quic.fe.stream.max-total". If the window was
reduced under load and the load then drops, the increment computed close
to the end of the connection may exceed the remaining streams, and the
next released stream hits BUG_ON(qcc->lfctl.ms_bidi > max).

Let's cap the increment to the remaining streams. It is still at least 1
since ms_bidi is below max there.

This was introduced by commit e139dd90e ("MAJOR: mux_quic: support
stream elasticity during connection lifetime") in 3.4-dev13 and must be
backported to 3.4.

src/mux_quic.c

index d00aaeb8cb78ce64b6f544364e0c5e1021d1346d..c490a8e08f6499c08258d120f58832289d1fa029 100644 (file)
@@ -2657,6 +2657,9 @@ static int qcc_release_remote_stream(struct qcc *qcc, uint64_t id)
 
                                /* Update flow control limit up to the allowed elasticity limit. */
                                inc = conn_max - rem;
+                               /* never exceed max, still >= 1 as ms_bidi < max */
+                               if (inc > max - qcc->lfctl.ms_bidi)
+                                       inc = max - qcc->lfctl.ms_bidi;
                                _HA_ATOMIC_ADD(&tg_ctx->committed_extra_streams, inc - non_extra);
                                qcc->lfctl.ms_bidi_rel = rem + inc;
                        }