Skip to content

Commit

Permalink
BUG/MEDIUM: quic: properly decount out-of-order ACK on stream release
Browse files Browse the repository at this point in the history
Out-of-order STREAM ACK are buffered in its related streambuf tree. On
insertion, overlapping or contiguous ranges are merged together. The
total size of buffered ack range is stored in <room> streambuf member
and reported to QUIC MUX layer on streambuf release. The objective is to
ensure QUIC MUX layer can allocate Tx buffers conveniently to preserve a
good transfer throughput.

Streamdesc is the overall container of many streambufs. It may also been
released when its upper QCS instance is freed, after all stream data
have been emitted. In this case, the active streambuf is also released
via custom code. However, in this code path, <room> was not reported to
the QUIC MUX layer.

This bug caused wrong estimation for the QUIC MUX txbuf window, with
bytes reamining even after all ACK reception. This may cause transfer
freeze on other connection streams, with RESET_STREAM emission on
timeout client.

To fix this, reuse the existing qc_stream_buf_release() function on
streamdesc release. This ensures that notify_room is correctly used.

No need to backport.
  • Loading branch information
a-denoyelle committed Oct 9, 2024
1 parent f0049d0 commit 456c399
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/quic_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,14 @@ void qc_stream_desc_release(struct qc_stream_desc *stream,
if (final_size < tail_offset)
b_sub(buf, tail_offset - final_size);

if (!b_data(buf)) {
/* This will ensure notify_room is triggered. */
/* Release active buffer, or delete it immediatly if there is
* no data to acknowledge. Both functions will reset active
* buf pointer and invoke <notify_room> if necessary.
*/
if (!b_data(buf))
qc_stream_buf_free(stream, &stream_buf);
}
else if (stream->notify_room && b_room(buf)) {
stream->notify_room(stream, b_room(buf));
}

stream->buf = NULL;
else
qc_stream_buf_release(stream);
}

if (qc_stream_desc_done(stream)) {
Expand Down

0 comments on commit 456c399

Please sign in to comment.