Skip to content

Commit 433dcd4

Browse files
committed
connect: skip errors propagation of ETIMEDOUT that connect(2) returns
1 parent d8b7275 commit 433dcd4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/connect.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,12 @@ func connectEphemeral(ctx context.Context, addrport string) error {
435435
err := measureTime(addrport, func() error {
436436
conn, err := dialer.Dial("tcp", addrport)
437437
if err != nil {
438-
return xerrors.Errorf("could not dial %q: %w", addrport, err)
438+
err := xerrors.Errorf("could not dial %q: %w", addrport, err)
439+
if errors.Is(err, syscall.ETIMEDOUT) {
440+
log.Println(err)
441+
return nil
442+
}
443+
return err
439444
}
440445
defer conn.Close()
441446

0 commit comments

Comments
 (0)