Skip to content

Commit

Permalink
Explicitly disable gRPC idle timeout
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nixpanic authored and mergify[bot] committed Nov 9, 2023
1 parent d97f4c3 commit 5ccc76e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 5ccc76e

Please sign in to comment.