From: Amaury Denoyelle Date: Mon, 20 Nov 2023 14:45:36 +0000 (+0100) Subject: MINOR: quic: remove unneeded QUIC specific stopping function X-Git-Tag: v2.9-dev11~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=decf29d06d1deb51bbcd7550c279a7135f5b8ad4;p=thirdparty%2Fhaproxy.git MINOR: quic: remove unneeded QUIC specific stopping function On CONNECTION_CLOSE reception/emission, QUIC connections enter CLOSING state. At this stage, only CONNECTION_CLOSE can be reemitted and all other exchanges are stopped. Previously, on haproxy process stopping, if all QUIC connections were in CLOSING state, they were released before their closing timer expiration to not block the process shutdown. However, since a recent commit, the closing timer has been shorten to a more reasonable delay. It is now consider viable to respect connections closing state even on process shutdown. As such, stopping specific code in QUIC connections idle timer task was removed. A specific function quic_handle_stopping() was implemented to notify QUIC connections on shutdown from main() function. It should have been deleted along the removal in QUIC idle timer task. This patch just does this. --- diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h index 640fe5bcc9..6263231c56 100644 --- a/include/haproxy/quic_conn.h +++ b/include/haproxy/quic_conn.h @@ -606,20 +606,6 @@ int qc_parse_hd_form(struct quic_rx_packet *pkt, int quic_dgram_parse(struct quic_dgram *dgram, struct quic_conn *qc, struct listener *li); -/* Wake up every QUIC connections on closing/draining state if process stopping - * is active. They will be immediately released so this ensures haproxy process - * stopping is not delayed by them. - */ -static inline void quic_handle_stopping(void) -{ - struct quic_conn *qc; - - if (stopping) { - list_for_each_entry(qc, &th_ctx->quic_conns_clo, el_th_ctx) - task_wakeup(qc->idle_timer_task, TASK_WOKEN_OTHER); - } -} - int qc_set_tid_affinity(struct quic_conn *qc, uint new_tid, struct listener *new_li); void qc_finalize_affinity_rebind(struct quic_conn *qc); diff --git a/src/haproxy.c b/src/haproxy.c index 33e8ae8671..935cb52e86 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2995,9 +2995,6 @@ void run_poll_loop() /* stop muxes/quic-conns before acknowledging stopping */ if (!(tg_ctx->stopping_threads & ti->ltid_bit)) { task_wakeup(mux_stopping_data[tid].task, TASK_WOKEN_OTHER); -#ifdef USE_QUIC - quic_handle_stopping(); -#endif wake = 1; } diff --git a/src/quic_conn.c b/src/quic_conn.c index 9bceea7e60..4994cb89af 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -2021,9 +2021,11 @@ void qc_finalize_affinity_rebind(struct quic_conn *qc) BUG_ON(!(qc->flags & QUIC_FL_CONN_AFFINITY_CHANGED)); qc->flags &= ~QUIC_FL_CONN_AFFINITY_CHANGED; - /* A connection must not pass to closing state until affinity rebind - * is completed. Else quic_handle_stopping() may miss it during process - * stopping cleanup. + /* If quic_conn is closing it is unnecessary to migrate it as it will + * be soon released. Besides, special care must be taken for CLOSING + * connections (using quic_cc_conn and th_ctx.quic_conns_clo list for + * instance). This should never occur as CLOSING connections are + * skipped by quic_sock_accept_conn(). */ BUG_ON(qc->flags & (QUIC_FL_CONN_CLOSING|QUIC_FL_CONN_DRAINING));