cloudflared-mirror/connection
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
..
connection.go TUN-9319: Add dynamic loading of features to connections via ConnectionOptionsSnapshot 2025-05-14 20:11:05 +00:00
connection_test.go TUN-9255: Improve flush on write conditions in http2 tunnel type to match what is done on the edge 2025-04-24 11:49:19 +00:00
control.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
errors.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
event.go TUN-8728: implement diag/tunnel endpoint 2024-11-25 10:43:32 -08:00
header.go TUN-8861: Add session limiter to TCP session manager 2025-01-20 10:53:53 +00:00
header_test.go chore: Remove h2mux code 2024-10-15 13:10:30 -07:00
http2.go TUN-9319: Add dynamic loading of features to connections via ConnectionOptionsSnapshot 2025-05-14 20:11:05 +00:00
http2_test.go TUN-9016: update go to 1.24 2025-06-06 09:05:49 +00:00
json.go TUN-3467: Serialize cf-cloudflared-response-meta during package initialization using jsoniter 2020-11-11 15:11:42 +00:00
metrics.go chore: Remove h2mux code 2024-10-15 13:10:30 -07:00
observer.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
observer_test.go TUN-6583: Remove legacy --ui flag 2022-07-20 16:17:29 -07:00
protocol.go TUN-8855: fix lint issues 2025-01-30 03:53:24 -08:00
protocol_test.go TUN-6938: Force h2mux protocol to http2 for named tunnels 2023-02-06 11:06:02 -08:00
quic.go TUN-8661: Refactor connection methods to support future different datagram muxing methods 2024-10-24 11:42:02 -07:00
quic_connection.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
quic_connection_test.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
quic_datagram_v2.go CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
quic_datagram_v2_test.go TUN-9470: Add OriginDialerService to include TCP 2025-06-30 13:24:16 -07:00
quic_datagram_v3.go TUN-9322: Add metric for unsupported RPC commands for datagram v3 2025-05-13 16:11:09 +00:00
tunnelsforha.go TUN-3471: Add structured log context to logs 2021-01-05 20:21:16 +00:00