MINOR: quic: finalize affinity change as soon as possible
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 26 Apr 2023 15:15:37 +0000 (17:15 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 26 Apr 2023 15:50:16 +0000 (17:50 +0200)
commitd6646dddccb1aae08f60717b5b6743c513c37299
tree90383095be2c511ab375e4208b04d78691ca3c17
parenta57ab0fabe7aae9a67d03f3a1e87052cdef32efd
MINOR: quic: finalize affinity change as soon as possible

During accept, a quic-conn is rebind to a new thread. This process is
done in two times :
* first on the original thread via qc_set_tid_affinity()
* then on the newly assigned thread via qc_finalize_affinity_rebind()

Most quic_conn operations (I/O tasklet, task and quic_conn FD socket
read) are reactivated ony after the second step. However, there is a
possibility that datagrams are handled before it via quic_dgram_parse()
when using listener sockets. This does not seem to cause any issue but
this may cause unexpected behavior in the future.

To simplify this, qc_finalize_affinity_rebind() will be called both by
qc_xprt_start() and quic_dgram_parse(). Only one invocation will be
performed thanks to the new flag QUIC_FL_CONN_AFFINITY_CHANGED.

This should be backported up to 2.7.
include/haproxy/quic_conn-t.h
src/quic_conn.c
src/xprt_quic.c