daemon: remove workaround for c8d client connection timeout

This workaround was added in df519e9e1a, pending
a fix in containerd;

> daemon: Fix giving up too early while connecting to containerd socket
>
> Explicitly set the gRPC connection params to take the timeout into
> account to workaround the containerd v2 client not passing down the
> stack.
>
> containerd v2 replaced usages of deprecated gRPC functions but didn't
> pass the timeout to the actual dial connection options.

A fix for this was merged in [containerd@ee574e7], which is part of containerd
v2.1.0-beta.0, and backported to containerd v2.0.4 through [containerd@6b5efba].

[containerd@ee574e7]: ee574e76e7
[containerd@6b5efba]: 6b5efba83b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-11 17:55:44 +01:00
parent 07453d15d0
commit 7e78088f8f
2 changed files with 1 additions and 8 deletions

View File

@@ -280,19 +280,14 @@ func (r *remote) monitorDaemon(ctx context.Context) {
continue
}
const connTimeout = 60 * time.Second
client, err = containerd.New(
r.GRPC.Address,
containerd.WithTimeout(connTimeout),
containerd.WithTimeout(60*time.Second),
containerd.WithDialOpts([]grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialer.ContextDialer),
grpc.WithUnaryInterceptor(grpcerrors.UnaryClientInterceptor),
grpc.WithStreamInterceptor(grpcerrors.StreamClientInterceptor),
grpc.WithConnectParams(grpc.ConnectParams{
// TODO: Remove after https://github.com/containerd/containerd/pull/11508
MinConnectTimeout: connTimeout,
}),
}),
)
if err != nil {