Skip to content

Commit 91d9c43

Browse files
capflama-denoyelle
authored andcommitted
BUG/MEDIUM: mux-quic: Unblock zero-copy forwarding if the txbuf can be released
In done_fastfwd() callback function, if nothing was forwarding while the SD is blocked, it means there is not enough space in the buffer to proceed. It may be because there are data to be sent. But it may also be data already sent waiting for an ack. In this case, no data to be sent by the mux. So the quic stream is not woken up when data are finally removed from the buffer. The data forwarding can thus be stuck. This happens when the stats page is requested in QUIC/H3. Only applets are affected by this issue and only with the QUIC multiplexer because it is the only mux with already sent data in the TX buf. To fix the issue, the idea is to release the txbuf if possible and then unblock the SD to perform a new zero-copy data forwarding attempt. Doing so, and thanks to the previous patch ("MEDIUM: applet: Be able to unblock zero-copy data forwarding from done_fastfwd"), the applet will be woken up. This patch should fix the issue #2584. It must be backported to 3.0. (cherry picked from commit 792a645) Signed-off-by: Amaury Denoyelle <[email protected]>
1 parent 47c5f80 commit 91d9c43

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/mux_quic.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3046,8 +3046,16 @@ static size_t qmux_strm_done_ff(struct stconn *sc)
30463046
qcs->flags |= QC_SF_FIN_STREAM;
30473047
}
30483048

3049-
if (!(qcs->flags & QC_SF_FIN_STREAM) && !sd->iobuf.data)
3049+
if (!(qcs->flags & QC_SF_FIN_STREAM) && !sd->iobuf.data) {
3050+
TRACE_STATE("no data sent", QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
3051+
3052+
/* There is nothing to forward and the SD is blocked. Try to
3053+
* release the TXBUF to retry.
3054+
*/
3055+
if ((qcs->sd->iobuf.flags & IOBUF_FL_FF_BLOCKED) && !qcc_release_stream_txbuf(qcs))
3056+
qcs->sd->iobuf.flags &= ~IOBUF_FL_FF_BLOCKED;
30503057
goto end;
3058+
}
30513059

30523060
data += sd->iobuf.offset;
30533061
total = qcs->qcc->app_ops->done_ff(qcs);

0 commit comments

Comments
 (0)