Browse Source

control/controlhttp: reduce some log spam on context cancel

Change-Id: I3ac00ddb29c16e9791ab2be19f454dabd721e4c3
Signed-off-by: Brad Fitzpatrick <[email protected]>
Brad Fitzpatrick 11 months ago
parent
commit
29c2bb1db6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      control/controlhttp/client.go

+ 5 - 0
control/controlhttp/client.go

@@ -249,6 +249,11 @@ func (a *Dialer) dial(ctx context.Context) (*ClientConn, error) {
 		results[i].conn = nil // so we don't close it in the defer
 		return conn, nil
 	}
+	if ctx.Err() != nil {
+		a.logf("controlhttp: context aborted dialing")
+		return nil, ctx.Err()
+	}
+
 	merr := multierr.New(errs...)
 
 	// If we get here, then we didn't get anywhere with our dial plan; fall back to just using DNS.