diff --git a/shared/relay/client/client.go b/shared/relay/client/client.go index acc5fee0a..c851ab329 100644 --- a/shared/relay/client/client.go +++ b/shared/relay/client/client.go @@ -681,6 +681,9 @@ func (c *Client) onDatagramTooLarge(conn net.Conn, cause error) { // Without the shared tracker a reconnect would just race QUIC again and // re-fail, so leave the connection up rather than loop. if c.transportFallback == nil { + if c.datagramFallbackTriggered.CompareAndSwap(false, true) { + c.log.Debugf("%s, but no transport fallback configured, leaving connection up", cause) + } return } diff --git a/shared/relay/client/dialer/race_dialer.go b/shared/relay/client/dialer/race_dialer.go index 16641f6d0..aef1ef464 100644 --- a/shared/relay/client/dialer/race_dialer.go +++ b/shared/relay/client/dialer/race_dialer.go @@ -91,6 +91,9 @@ func (r *RaceDial) Dial(ctx context.Context) (net.Conn, error) { // falling back to the next on failure. func (r *RaceDial) dialSequential(ctx context.Context) (net.Conn, error) { for _, dfn := range r.dialerFns { + if err := ctx.Err(); err != nil { + return nil, err + } attemptCtx, cancel := context.WithTimeout(ctx, r.connectionTimeout) r.log.Infof("dialing Relay server via %s", dfn.Protocol()) conn, err := dfn.Dial(attemptCtx, r.serverURL, r.serverName)