diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h index 8b7a43a5f..8342c9baf 100644 --- a/include/haproxy/quic_conn.h +++ b/include/haproxy/quic_conn.h @@ -725,5 +725,19 @@ void qc_kill_conn(struct quic_conn *qc); 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); + } +} + #endif /* USE_QUIC */ #endif /* _HAPROXY_QUIC_CONN_H */ diff --git a/src/haproxy.c b/src/haproxy.c index eb490804a..19463f29e 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -115,7 +115,7 @@ #include #include #include -#include +#include #include #include #include @@ -2971,9 +2971,12 @@ void run_poll_loop() int i; if (stopping) { - /* stop muxes before acknowledging stopping */ + /* 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; }