]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-quic: do not prevent non-STREAM sending on flow control
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Jan 2024 10:42:08 +0000 (11:42 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 12 Jan 2024 15:53:41 +0000 (16:53 +0100)
Data emitted by QUIC MUX is restrained by the peer flow control. This is
checked on stream and connection level inside qcc_io_send().

The connection level check was placed early in qcc_io_send() preambule.
However, this also prevents emission of other frames STOP_SENDING and
RESET_STREAM, until flow control limitation is increased by a received
MAX_DATA. Note that local flow control frame emission is done prior in
qcc_io_send() and so are not impacted.

In the worst case, if no MAX_DATA is received for some time, this could
delay significantly streams closure and resource free. However, this
should be rare as other peers should anticipate emission of MAX_DATA
before reaching flow control limit. In the end, this is also covered by
the MUX timeout so the impact should be minimal

To fix this, move the connection level check directly inside QCS sending
loop. Note that this could cause unnecessary looping when connection
flow control level is reached and no STOP_SENDING/RESET_STREAM are
needed.

This should be backported up to 2.6.

src/mux_quic.c

index f2d5d19a89fbbaaa1b285e9672e5ac129b52e50b..a6af629a8d3a66e74a5d470f8564994dae8c53cd 100644 (file)
@@ -2054,9 +2054,6 @@ static int qcc_io_send(struct qcc *qcc)
                }
        }
 
-       if (qcc->flags & QC_CF_BLK_MFCTL)
-               goto out;
-
        /* Send STREAM/STOP_SENDING/RESET_STREAM data for registered streams. */
        list_for_each_entry_safe(qcs, qcs_tmp, &qcc->send_list, el_send) {
                /* Check if all QCS were processed. */
@@ -2100,7 +2097,8 @@ static int qcc_io_send(struct qcc *qcc)
                        continue;
                }
 
-               if (!(qcs->flags & QC_SF_BLK_SFCTL)) {
+               if (!(qcc->flags & QC_CF_BLK_MFCTL) &&
+                   !(qcs->flags & QC_SF_BLK_SFCTL)) {
                        if ((ret = qcs_send(qcs, &frms)) < 0) {
                                /* Temporarily remove QCS from send-list. */
                                LIST_DEL_INIT(&qcs->el_send);