]> git.kaiwu.me - haproxy.git/commit
MINOR: mux_quic: release BE conns if reuse definitely blocked
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 30 Apr 2026 14:58:18 +0000 (16:58 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 7 May 2026 09:19:22 +0000 (11:19 +0200)
commitb8961ee8b39a29523e28fe10db6e58788bf9019a
treea67d4ffb4c02a17f0b2a824fcfa9c1be6bfdc22d
parente586458ec0c22c6a1f26b2d4dd98fec1f07fabc1
MINOR: mux_quic: release BE conns if reuse definitely blocked

avail_streams callback serves to indicates how many streams can be
attached for a backend connection. On QUIC mux, this relies on several
parameters, first based on static limitation which only decreases over
time, but also on flow control which is dynamically adjusted by the peer
and can be increased or decreased at will.

qcc_is_dead() on the other hand serves to determine if a connection can
be removed. First, it must be inactive (no request in progress). Then,
if a backend connection cannot be reused due to some of the above
limitation reached, it is definitely useless and should be removed as
soon as possible. However, prior to this patch, qcc_is_dead() did not
take into account the same set of parameters than avail_streams : only
if graceful shutdown was initiated by the peer was considered.

The purpose of this patch is to linked these two functions together.
Reuse calcul based on static limits is extracted from avail_streams()
into new qcc_be_is_reusable(). This function is used directly in
qcc_is_dead(), which now for example takes into account the server
max-reuse parameter.

This patch should ensure that a backend connection which can not be
reuse anymore is release as soon as possible. This could improve
slightly reuse rate in some specific scenarii as non-reusable
connections should not pollute the idle cache.

Return value of QUIC avail_streams() is changed by this patch as server
max-reuse and max stream ID limits are now only taken into account when
already exceeded or if a single stream remains. However, this has no
consequence as callers of avail_streams() do not differentiates return
value of 2 or more.
src/mux_quic.c