cloudflared-mirror/quic
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
..
v3 CUSTESC-53681: Correct QUIC connection management for datagram handlers 2025-08-19 16:10:00 -07:00
constants.go TUN-8415: Refactor capnp rpc into a single module 2024-05-17 11:22:07 -07:00
conversion.go TUN-8243: Collect metrics on the number of QUIC frames sent/received 2024-02-19 10:09:14 +00:00
datagram.go TUN-8006: Update quic-go to latest upstream 2023-12-04 17:09:40 +00:00
datagram_test.go TUN-8006: Update quic-go to latest upstream 2023-12-04 17:09:40 +00:00
datagramv2.go TUN-8006: Update quic-go to latest upstream 2023-12-04 17:09:40 +00:00
metrics.go TUN-9322: Add metric for unsupported RPC commands for datagram v3 2025-05-13 16:11:09 +00:00
param_unix.go TUN-5623: Configure quic max datagram frame size to 1350 bytes for none Windows platforms 2022-01-11 14:55:43 +00:00
param_windows.go TUN-7227: Migrate to devincarr/quic-go 2023-05-10 19:44:15 +00:00
safe_stream.go TUN-8297: Improve write timeout logging on safe_stream.go 2024-03-13 13:30:45 +00:00
safe_stream_test.go TUN-8415: Refactor capnp rpc into a single module 2024-05-17 11:22:07 -07:00
tracing.go TUN-8456: Update quic-go to 0.45 and collect mtu and congestion control metrics 2024-06-17 15:28:56 +00:00