Skip to content

Commit

Permalink
MINOR: quic: ensure quic_conn is never removed on thread affinity rebind
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
a-denoyelle committed Jul 3, 2024
1 parent 9655b89 commit ced56de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/quic_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ced56de

Please sign in to comment.