]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: do not proceed to accept for closing conn
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 17 Apr 2023 07:31:16 +0000 (09:31 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Apr 2023 14:54:48 +0000 (16:54 +0200)
Each quic_conn is inserted in an accept queue to allocate the upper
layers. This is done through a listener tasklet in
quic_sock_accept_conn().

This patch interrupts the accept process for a quic_conn in
closing/draining state. Indeed, this connection will soon be closed so
it's unnecessary to allocate a complete stack for it.

This patch will become necessary when thread migration is implemented.
Indeed, it won't be allowed to proceed to thread migration for a closing
quic_conn.

This should be backported up to 2.7 after a period of observation.

src/quic_sock.c

index 2ecc96bae8fe42edf4f6f20268b23e49069b8f37..ac83b988333f1bb6afa5f9f96ac6ead04cb8cfe4 100644 (file)
@@ -150,7 +150,7 @@ struct connection *quic_sock_accept_conn(struct listener *l, int *status)
        struct li_per_thread *lthr = &l->per_thr[tid];
 
        qc = MT_LIST_POP(&lthr->quic_accept.conns, struct quic_conn *, accept_list);
-       if (!qc)
+       if (!qc || qc->flags & (QUIC_FL_CONN_CLOSING|QUIC_FL_CONN_DRAINING))
                goto done;
 
        if (!new_quic_cli_conn(qc, l, &qc->peer_addr))