When default "connection" value is set, a dedicated socket will be allocated
by every QUIC connections. This option is the preferred one to achieve the
- best performance with a large QUIC traffic. However, this relies on some
- advanced features from the UDP network stack. If your platform is deemed not
- compatible, haproxy will automatically switch to "listener" mode on startup.
+ best performance with a large QUIC traffic. This is also the only way to
+ ensure soft-stop is conducted properly without data loss for QUIC
+ connections. However, this relies on some advanced features from the UDP
+ network stack. If your platform is deemed not compatible, haproxy will
+ automatically switch to "listener" mode on startup.
The "listener" value indicates that QUIC transfers will occur on the shared
listener socket. This option can be a good compromise for small traffic as it
is a list of pids to signal (one per argument). The list ends on any
option starting with a "-". It is not a problem if the list of pids is
empty, so that it can be built on the fly based on the result of a command
- like "pidof" or "pgrep". QUIC connections will be aborted.
+ like "pidof" or "pgrep".
-st <pid>* : send the "terminate" signal (SIGTERM) to older processes after
boot completion to terminate them immediately without finishing what they
users, the failure rate is still fairly within the noise margin provided that at
least SO_REUSEPORT is properly supported on their systems.
-QUIC limitations: soft-stop is not supported. In case of reload, QUIC connections
-will not be preserved.
-
5. File-descriptor limitations
------------------------------
is_addr(local_addr)) {
TRACE_USER("Allocate a socket for QUIC connection", QUIC_EV_CONN_INIT, qc);
qc_alloc_fd(qc, local_addr, peer_addr);
+
+ /* haproxy soft-stop is supported only for QUIC connections
+ * with their owned socket.
+ */
+ if (qc_test_fd(qc))
+ _HA_ATOMIC_INC(&jobs);
}
/* insert the allocated CID in the receiver datagram handler tree */
/* We must not free the quic-conn if the MUX is still allocated. */
BUG_ON(qc->mux_state == QC_MUX_READY);
+ if (qc_test_fd(qc))
+ _HA_ATOMIC_DEC(&jobs);
+
/* Close quic-conn socket fd. */
qc_release_fd(qc, 0);
pool_free(pool_head_quic_conn_rxbuf, qc->rx.buf.area);
pool_free(pool_head_quic_conn, qc);
+
TRACE_PROTO("QUIC conn. freed", QUIC_EV_CONN_FREED, qc);
TRACE_LEAVE(QUIC_EV_CONN_CLOSE, qc);
/* TODO try to reuse socket instead of closing it and opening a new one. */
TRACE_STATE("Connection migration detected, allocate a new connection socket", QUIC_EV_CONN_LPKT, qc);
qc_release_fd(qc, 1);
+ /* TODO need to adjust <jobs> on socket allocation failure. */
qc_alloc_fd(qc, local_addr, peer_addr);
}