]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux_quic: account data in conn fctl on early detach
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 29 Sep 2026 14:39:17 +0000 (16:39 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 7 Oct 2026 08:33:56 +0000 (10:33 +0200)
The previous patch accounts unconsumed data when QCS is freed before
being remotely closed. The objective is to ensure to limit the
inconsistency in conn flow control between client and server.

In fact, this patch is incomplete as peer consumed level cannot be known
before receiving its final size. Thus, discrepancies in connection flow
control may still appear over time. The proper method is to delay QCS
release until remote close is performed. However, this is a significant
change which will be implemented in a future patch.

This must be backported up to 2.8, after a period of observation

src/mux_quic.c

index 403acbfcd6ba9a9995c5ec9f75c7df6aa390eae9..996904d143789e13a8f8fcd97f4a951a5e226a05 100644 (file)
@@ -2670,6 +2670,19 @@ static void qcs_destroy(struct qcs *qcs)
                        qcc_release_remote_stream(qcc, id);
        }
 
+       /* If some data are not yet consumed, account them in conn flow
+        * control. On frontend, this may happen when FE stream is released
+        * prior to request completion.
+        *
+        * TODO QCS should not be released if not closed remotely to guarantee
+        * the connection flow control consistency
+        */
+       if (!qcs_is_close_remote(qcs) && qcs->rx.offset_max > qcs->rx.offset) {
+               COUNT_IF(1, "QCS is released while not remotely closed. "
+                           "This may cause miscalculation in conn flow control.");
+               qcc_account_for_conn_fctl(qcc, qcs->rx.offset_max - qcs->rx.offset);
+       }
+
        qcs_free(qcs);
 
        /* Rearm http-keep-alive timeout when last request stream is freed. */