Log skipped relay fallback and bail sequential dial on cancelled context

This commit is contained in:
Viktor Liu
2026-06-04 13:18:23 +02:00
parent fbd97d6da5
commit 36f346c0fe
2 changed files with 6 additions and 0 deletions
@@ -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)