]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: ensure quic_conn is never removed on thread affinity rebind
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 1 Jul 2024 13:36:33 +0000 (15:36 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 3 Jul 2024 13:02:40 +0000 (15:02 +0200)
On accept, quic_conn instance is migrated from its original thread to a
new one. This operation is conducted in two steps, on the original than
the new thread instance. During the interval, quic_conn is artificially
rendered inactive. It must never be accessed nor removed until migration
is completed via qc_finalize_affinity_rebind(). This new BUG_ON() will
enforce that removal is never conducted until migration is completed.

src/quic_conn.c

index 595dcf0448ce655f36768a430ff623fbcaff70ab..46c74d9436a94a6a5a44176340f264d3a7860cff 100644 (file)
@@ -1314,6 +1314,9 @@ void quic_conn_release(struct quic_conn *qc)
        if (!qc)
                goto leave;
 
+       /* Must not delete a quic_conn if thread affinity rebind in progress. */
+       BUG_ON(qc->flags & QUIC_FL_CONN_AFFINITY_CHANGED);
+
        /* We must not free the quic-conn if the MUX is still allocated. */
        BUG_ON(qc->mux_state == QC_MUX_READY);