From 5ccc76edb93d10019a839d9414aa488bfcd6aca4 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 9 Nov 2023 16:26:38 +0100 Subject: [PATCH] Explicitly disable gRPC idle timeout The idle timeout was disabled, but has been enabled by default in google.golang.org/grpc v1.59. The kubernetes-csi-addons operator acts similarly to the Kubernetes external-provisioner, and benefits from having a functional gRPC connection open to the csi-addons sidecars that run alongside CSI-drivers. See-also: kubernetes-csi/external-provisioner#1099 Signed-off-by: Niels de Vos --- internal/connection/connection.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/connection/connection.go b/internal/connection/connection.go index 60463df66..d439ce9ec 100644 --- a/internal/connection/connection.go +++ b/internal/connection/connection.go @@ -38,8 +38,11 @@ type Connection struct { // NewConnection establishes connection with sidecar, fetches capability and returns Connection object // filled with required information. func NewConnection(ctx context.Context, endpoint, nodeID, driverName string) (*Connection, error) { - opts := grpc.WithTransportCredentials(insecure.NewCredentials()) - cc, err := grpc.Dial(endpoint, opts) + opts := []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithIdleTimeout(time.Duration(0)), + } + cc, err := grpc.Dial(endpoint, opts...) if err != nil { return nil, err }