cloudflared-mirror/supervisor
Devin Carr 41dffd7f3c CUSTESC-53681: Correct QUIC connection management for datagram handlers
Corrects the pattern of using errgroup's and context cancellation to simplify the logic for canceling extra routines for the QUIC connection. This is because the extra context cancellation is redundant with the fact that the errgroup also cancels it's own provided context when a routine returns (error or not).

For the datagram handler specifically, since it can respond faster to a context cancellation from the QUIC connection, we wrap the error before surfacing it outside of the QUIC connection scope to the supervisor. Additionally, the supervisor will look for this error type to check if it should retry the QUIC connection. These two operations are required because the supervisor does not look for a context canceled error when deciding to retry a connection. If a context canceled from the datagram handler were to be returned up to the supervisor on the initial connection, the cloudflared application would exit. We want to ensure that cloudflared maintains connection attempts even if any of the services on-top of a QUIC connection fail (datagram handler in this case).

Additional logging is also introduced along these paths to help with understanding the error conditions from the specific handlers on-top of a QUIC connection.

Related CUSTESC-53681

Closes TUN-9610
2025-08-19 16:10:00 -07:00
..
conn_aware_logger.go TUN-6617: Dont fallback to http2 if QUIC conn was successful. 2022-08-12 08:40:03 +00:00
external_control.go TUN-5749: Refactor cloudflared to pave way for reconfigurable ingress 2022-02-14 15:37:09 +00:00
fuse.go chore: Remove h2mux code 2024-10-15 13:10:30 -07:00
metrics.go TUN-5749: Refactor cloudflared to pave way for reconfigurable ingress 2022-02-14 15:37:09 +00:00
pqtunnels.go TUN-9161: Remove P256Kyber768Draft00PQKex curve from nonFips curve preferences 2025-07-01 12:24:59 +01:00
pqtunnels_test.go TUN-9161: Remove P256Kyber768Draft00PQKex curve from nonFips curve preferences 2025-07-01 12:24:59 +01:00
supervisor.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
tunnel.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
tunnel_test.go TUN-8427: Fix BackoffHandler's internally shared clock structure 2024-05-23 09:48:34 -07:00
tunnelsforha.go TUN-5749: Refactor cloudflared to pave way for reconfigurable ingress 2022-02-14 15:37:09 +00:00