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.
/* 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;
}