]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: close connection when reaching max-total streams
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 15 Apr 2026 12:33:31 +0000 (14:33 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 15 Apr 2026 13:18:37 +0000 (15:18 +0200)
This commit completes the previous one which implements a new setting to
limit the number of streams usable by a client on a QUIC connection.

When the connection becomes idle after reaching this limit, it is
immediately closed. This is implemented by extending checks in
qcc_is_dead(). This results in a CONNECTION_CLOSE emission, which is
useful to free resources as soon as possible.

doc/configuration.txt
src/mux_quic.c

index 905c068108e1d5e1637389f53df1f3d2962d8ada..1568978fb1cf728de9a5a3a0b221f6217c2b9b0c 100644 (file)
@@ -5263,7 +5263,8 @@ tune.quic.fe.stream.max-concurrent <number>
 tune.quic.fe.stream.max-total <number>
   Sets the maximum number of requests that can be handled by a single QUIC
   connection. Once this total is reached, the connection will be gracefully
-  shutdown. In HTTP/3, this translates in a GOAWAY frame.
+  shutdown. In HTTP/3, this translates in a GOAWAY frame. The connection is
+  finally closed when all remaining transfers are completed.
 
   This setting is applied as a hard limit on the connection via the QUIC flow
   control mechanism. If a peer violates it, the connection will be immediately
index aed5b941ea81a58964bc6d322eaa452c82e9de6c..d0c84ccbe50f868c11a2330d829b0d266d7f78ed 100644 (file)
@@ -287,9 +287,11 @@ static inline int qcc_is_dead(const struct qcc *qcc)
         * - remote error detected at transport level
         * - error detected locally
         * - MUX timeout expired
+        * - app layer shut and all transfers done (FE side only - used for stream.max-total)
         */
        if (qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL_DONE) ||
-           !qcc->task) {
+           !qcc->task ||
+           (!conn_is_back(qcc->conn) && !qcc->nb_hreq && qcc->app_st == QCC_APP_ST_SHUT)) {
                return 1;
        }