]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: disable glitch on backend side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Jul 2025 12:36:17 +0000 (14:36 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Jul 2025 12:39:18 +0000 (14:39 +0200)
For now, QUIC glitch limit counter is only available on the frontend
side. Thus, disable incrementation on the backend side for now. Also,
session is only available as conn <owner> reliably on the frontend side,
so session_add_glitch_ctr() operation is also securised.

src/mux_quic.c

index 74faaa493a29ec088757671094c51a6e51563821..7222a9f4d2340a7b187911ea261cc5a3099432e9 100644 (file)
@@ -760,6 +760,10 @@ int _qcc_report_glitch(struct qcc *qcc, int inc)
 {
        const int max = global.tune.quic_frontend_glitches_threshold;
 
+       /* TODO add a BE limit for glitch counter */
+       if (qcc->flags & QC_CF_IS_BACK)
+               return 0;
+
        qcc->glitches += inc;
        if (max && qcc->glitches >= max && !(qcc->flags & QC_CF_ERRL) &&
            (th_ctx->idle_pct <= global.tune.glitch_kill_maxidle)) {
@@ -1333,7 +1337,7 @@ static int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs)
        if (!(qcs->flags & QC_SF_READ_ABORTED)) {
                ret = qcc->app_ops->rcv_buf(qcs, &b, fin);
 
-               if (qcc->glitches != prev_glitches)
+               if (qcc->glitches != prev_glitches && !(qcc->flags & QC_CF_IS_BACK))
                        session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);
 
                if (ret < 0) {
@@ -2150,7 +2154,7 @@ int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t f
        }
 
  out:
-       if (qcc->glitches != prev_glitches)
+       if (qcc->glitches != prev_glitches && !(qcc->flags & QC_CF_IS_BACK))
                session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);
 
        TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn);
@@ -2256,7 +2260,7 @@ int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err)
                qcc_refresh_timeout(qcc);
 
  out:
-       if (qcc->glitches != prev_glitches)
+       if (qcc->glitches != prev_glitches && !(qcc->flags & QC_CF_IS_BACK))
                session_add_glitch_ctr(qcc->conn->owner, qcc->glitches - prev_glitches);
 
        TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn);