diff --git a/clientv3/client.go b/clientv3/client.go index 45e93c2c22e8..368323f73f04 100644 --- a/clientv3/client.go +++ b/clientv3/client.go @@ -221,7 +221,8 @@ func (c *Client) dialSetupOpts(endpoint string, dopts ...grpc.DialOption) (opts return nil, c.ctx.Err() default: } - return net.DialTimeout(proto, host, t) + dialer := &net.Dialer{Timeout: t} + return dialer.DialContext(c.ctx, proto, host) } opts = append(opts, grpc.WithDialer(f))