Skip to content

Commit

Permalink
BUG/MINOR: mux-quic: do not prevent non-STREAM sending on flow control
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 333f2ca)
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit 696337f)
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit 61e9109)
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit 445e15a)
 [ad: fix context]
Signed-off-by: Amaury Denoyelle <[email protected]>
  • Loading branch information
a-denoyelle committed Jan 19, 2024
1 parent 13b7c82 commit db439e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mux_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,9 +1693,6 @@ static int qc_send(struct qcc *qcc)
}
}

if (qcc->flags & QC_CF_BLK_MFCTL)
return 0;

if (!(qcc->flags & QC_CF_APP_FINAL) && !eb_is_empty(&qcc->streams_by_id) &&
qcc->app_ops->finalize) {
/* Finalize the application layer before sending any stream.
Expand Down Expand Up @@ -1731,7 +1728,8 @@ static int qc_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) {
node = eb64_next(node);
continue;
}
Expand Down

0 comments on commit db439e9

Please sign in to comment.