From 43e4a58053765d92cd6b07e592d8f946a3764124 Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Thu, 21 Dec 2023 22:48:10 +0000 Subject: [PATCH] Use grpc infinite timeout --- connection/connection.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/connection/connection.go b/connection/connection.go index cbdf7c34e..4e8891c69 100644 --- a/connection/connection.go +++ b/connection/connection.go @@ -115,14 +115,16 @@ func connect( } dialOptions = append(dialOptions, - grpc.WithInsecure(), // Don't use TLS, it's usually local Unix domain socket in a container. - grpc.WithBackoffMaxDelay(time.Second), // Retry every second after failure. - grpc.WithBlock(), // Block until connection succeeds. + grpc.WithInsecure(), // Don't use TLS, it's usually local Unix domain socket in a container. + grpc.WithBackoffMaxDelay(time.Second), // Retry every second after failure. + grpc.WithBlock(), // Block until connection succeeds. + grpc.WithIdleTimeout(time.Duration(0)), // Never close connection because of inactivity. grpc.WithChainUnaryInterceptor( LogGRPC, // Log all messages. ExtendedCSIMetricsManager{metricsManager}.RecordMetricsClientInterceptor, // Record metrics for each gRPC call. ), ) + unixPrefix := "unix://" if strings.HasPrefix(address, "/") { // It looks like filesystem path.