Skip to content

Commit 73d28dd

Browse files
author
Kazuyoshi Kato
committed
client: surface a connection error more clearly
gRPC-Go recently added grpc.WithReturnConnectionError() which improves the situation of containerd#2576. Permission errors: % ./bin/ctr t ls ctr: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied" % Non-existent sockets: % ./bin/ctr -a notfound t ls ctr: failed to dial "notfound": context deadline exceeded: connection error: desc = "transport: error while dialing: dial unix://notfound: timeout" % Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
1 parent 25d7f90 commit 73d28dd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
123123
grpc.FailOnNonTempDialError(true),
124124
grpc.WithConnectParams(connParams),
125125
grpc.WithContextDialer(dialer.ContextDialer),
126+
grpc.WithReturnConnectionError(),
126127

127128
// TODO(stevvooe): We may need to allow configuration of this on the client.
128129
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize)),

0 commit comments

Comments
 (0)