]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: remove unneeded QUIC specific stopping function
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 20 Nov 2023 14:45:36 +0000 (15:45 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 20 Nov 2023 16:59:52 +0000 (17:59 +0100)
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.

include/haproxy/quic_conn.h
src/haproxy.c
src/quic_conn.c

index 640fe5bcc929d73ab309a87cefd73ee5b435dd01..6263231c56d8583217f2d7e68b1de0813a42d573 100644 (file)
@@ -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);
 
index 33e8ae867149cf79d61b2da63e39be2a4dd8f700..935cb52e86f32d03a008a7fd4d749a32472631b6 100644 (file)
@@ -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;
                                }
 
index 9bceea7e60eed9afd5918ddd8ac91a5fde60757b..4994cb89afd94261050d5885536809e2fef9f41d 100644 (file)
@@ -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));