summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Denoyelle <adenoyelle@haproxy.com>2023-05-09 18:20:45 +0200
committerAmaury Denoyelle <adenoyelle@haproxy.com>2023-05-09 18:42:34 +0200
commitda24bcfad3051749c56a6bbc16ea362d7a47915d (patch)
treec67c8d1f33a87ac5f37eb62a23414f3b26d7115e
parent58721f2192e0ff2cf8c2cd84cddd83d4de717314 (diff)
downloadhaproxy-da24bcfad3051749c56a6bbc16ea362d7a47915d.tar.gz
BUG/MEDIUM: mux-quic: wakeup tasklet to close on error
A recent series of commit have been introduced to rework error generation on QUIC MUX side. Now, all MUX/APP functions uses qcc_set_error() to set the flag QC_CF_ERRL on error. Then, this flag is converted to QC_CF_ERRL_DONE with a CONNECTION_CLOSE emission by qc_send(). This has the advantage of centralizing the CONNECTION_CLOSE generation in one place and reduces the link between MUX and quic-conn layer. However, we must now ensure that every qcc_set_error() call is followed by a QUIC MUX tasklet to invoke qc_send(). This was not the case, thus when there is no active transfer, no CONNECTION_CLOSE frame is emitted and the connection remains opened. To fix this, add a tasklet_wakeup() directly in qcc_set_error(). This is a brute force solution as this may be unneeded when already in the MUX tasklet context. However, it is the simplest solution as it is too tedious for the moment to list all qcc_set_error() invocation outside of the tasklet. This must be backported up to 2.7.
-rw-r--r--src/mux_quic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mux_quic.c b/src/mux_quic.c
index 705008872..6746fc87e 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -510,6 +510,15 @@ void qcc_set_error(struct qcc *qcc, int err, int app)
qcc->flags |= QC_CF_ERRL;
qcc->err = app ? quic_err_app(err) : quic_err_transport(err);
+
+ /* TODO
+ * Ensure qc_send() will be conducted to convert QC_CF_ERRL in
+ * QC_CF_ERRL_DONE with CONNECTION_CLOSE frame emission. This may be
+ * unnecessary if we are currently in the MUX tasklet context, but it
+ * is too tedious too not forget a wakeup outside of this function for
+ * the moment.
+ */
+ tasklet_wakeup(qcc->wait_event.tasklet);
}
/* Open a locally initiated stream for the connection <qcc>. Set <bidi> for a