From 9f028b50cb314075c4cf0690f437908fa123a73b Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Fri, 9 Jun 2017 15:40:14 -0400 Subject: [PATCH] Don't use WithBlock() on `dist` gRPC connection When using WithBlock() on the dialer, the connection timeout must fully expire before any status is provided to the user about whether they can even connect to the socket. For example, if the containerd socket is root-owned and the user tries `dist images ls` without `sudo`, the default is 30 sec. of "hang" before the command returns. Signed-off-by: Phil Estes --- cmd/dist/common.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/dist/common.go b/cmd/dist/common.go index 501a37ab9..f1fd3c12f 100644 --- a/cmd/dist/common.go +++ b/cmd/dist/common.go @@ -102,7 +102,6 @@ func connectGRPC(context *cli.Context) (*grpc.ClientConn, error) { timeout := context.GlobalDuration("connect-timeout") return grpc.Dial(address, grpc.WithTimeout(timeout), - grpc.WithBlock(), grpc.WithInsecure(), grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) { return net.DialTimeout("unix", address, timeout)