Skip to content

Commit fcd6d29

Browse files
committed
BUG/MINOR: mux-quic: report glitches to session
Glitch counter was implemented for QUIC/HTTP3. The counter is stored in the QCC MUX connection instance. However, this is never reported at the session level which is necessary if glitch counter is tracked via a stick-table. To fix this, use session_add_glitch_ctr() in various QUIC MUX functions which may increment glitch counter. This should be backported up to 3.0.
1 parent 2c783c2 commit fcd6d29

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/mux_quic.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <haproxy/quic_sock.h>
2323
#include <haproxy/quic_stream.h>
2424
#include <haproxy/quic_tp-t.h>
25+
#include <haproxy/session.h>
2526
#include <haproxy/ssl_sock-t.h>
2627
#include <haproxy/stconn.h>
2728
#include <haproxy/time.h>
@@ -974,6 +975,7 @@ static int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs)
974975
struct buffer b;
975976
ssize_t ret;
976977
int fin = 0;
978+
int prev_glitches = qcc->glitches;
977979

978980
TRACE_ENTER(QMUX_EV_QCS_RECV, qcc->conn, qcs);
979981

@@ -985,6 +987,10 @@ static int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs)
985987

986988
if (!(qcs->flags & QC_SF_READ_ABORTED)) {
987989
ret = qcc->app_ops->rcv_buf(qcs, &b, fin);
990+
991+
if (qcc->glitches != prev_glitches)
992+
session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);
993+
988994
if (ret < 0) {
989995
TRACE_ERROR("decoding error", QMUX_EV_QCS_RECV, qcc->conn, qcs);
990996
goto err;
@@ -1566,6 +1572,7 @@ int qcc_recv_max_stream_data(struct qcc *qcc, uint64_t id, uint64_t max)
15661572
int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t final_size)
15671573
{
15681574
struct qcs *qcs;
1575+
int prev_glitches = qcc->glitches;
15691576

15701577
TRACE_ENTER(QMUX_EV_QCC_RECV, qcc->conn);
15711578

@@ -1624,6 +1631,9 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f
16241631
qcs_free_ncbuf(qcs, &qcs->rx.ncbuf);
16251632

16261633
out:
1634+
if (qcc->glitches != prev_glitches)
1635+
session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);
1636+
16271637
TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn);
16281638
return 0;
16291639

@@ -1641,6 +1651,7 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f
16411651
int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err)
16421652
{
16431653
struct qcs *qcs;
1654+
int prev_glitches = qcc->glitches;
16441655

16451656
TRACE_ENTER(QMUX_EV_QCC_RECV, qcc->conn);
16461657

@@ -1726,6 +1737,9 @@ int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err)
17261737
qcc_refresh_timeout(qcc);
17271738

17281739
out:
1740+
if (qcc->glitches != prev_glitches)
1741+
session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);
1742+
17291743
TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn);
17301744
return 0;
17311745

0 commit comments

Comments
 (0)