From 1dadb22aa942018b9b7b2256cf85ba401fe67cbf Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 24 Jan 2017 12:25:55 -0800 Subject: [PATCH] clientv3: use DialContext Fixes #7216 --- clientv3/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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))