BUG/MEDIUM: quic: refuse handshakes completed after the listener unbind
QUIC connections are accepted once their handshake is complete. When a
soft-stop unbinds the listener in the meantime, the connection is still
queued, but listener_accept() does not call accept_conn() anymore on the
unbound receiver. The connection never gets its mux and the client waits
until its timeout, while the stopping process keeps it until its idle
timeout and quic_accept_run() wakes itself up in a loop, using 100% of a
thread.
Let's close such connections with a CONNECTION_REFUSED error instead,
when their handshake completes on an unbound listener, or when they are
still queued once it is unbound. The client gets the error right after
its handshake and the stopping process can leave.
This was introduced in 2.8 with the soft-stop support for connections
with their own socket, by commit
fb375574f ("MINOR: quic: mark quic-conn
as jobs on socket allocation"). It should be backported to all stable
versions.
This was reported in GitHub issue #3578.