Skip to content

Commit

Permalink
Use grpc infinite timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
msau42 committed Dec 21, 2023
1 parent 7b2b0d3 commit 43e4a58
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 43e4a58

Please sign in to comment.