Skip to content

Commit 43e4a58

Browse files
committed
Use grpc infinite timeout
1 parent 7b2b0d3 commit 43e4a58

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

connection/connection.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,16 @@ func connect(
115115
}
116116

117117
dialOptions = append(dialOptions,
118-
grpc.WithInsecure(), // Don't use TLS, it's usually local Unix domain socket in a container.
119-
grpc.WithBackoffMaxDelay(time.Second), // Retry every second after failure.
120-
grpc.WithBlock(), // Block until connection succeeds.
118+
grpc.WithInsecure(), // Don't use TLS, it's usually local Unix domain socket in a container.
119+
grpc.WithBackoffMaxDelay(time.Second), // Retry every second after failure.
120+
grpc.WithBlock(), // Block until connection succeeds.
121+
grpc.WithIdleTimeout(time.Duration(0)), // Never close connection because of inactivity.
121122
grpc.WithChainUnaryInterceptor(
122123
LogGRPC, // Log all messages.
123124
ExtendedCSIMetricsManager{metricsManager}.RecordMetricsClientInterceptor, // Record metrics for each gRPC call.
124125
),
125126
)
127+
126128
unixPrefix := "unix://"
127129
if strings.HasPrefix(address, "/") {
128130
// It looks like filesystem path.

0 commit comments

Comments
 (0)