From 44e5cecdcaee14c15055d20d6b9a72e80cd4794d Mon Sep 17 00:00:00 2001 From: Taylor Thomas Date: Sat, 11 Nov 2017 14:05:24 -0800 Subject: [PATCH] fix(tiller): Forces close of idle gRPC connections Possibly fixes #3121. This forces idle connections to drop after 10 minutes --- cmd/tiller/tiller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/tiller/tiller.go b/cmd/tiller/tiller.go index f9ec0d4fc..96eeddacb 100644 --- a/cmd/tiller/tiller.go +++ b/cmd/tiller/tiller.go @@ -28,10 +28,12 @@ import ( "path/filepath" "strconv" "strings" + "time" goprom "github.com/grpc-ecosystem/go-grpc-prometheus" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" "k8s.io/helm/pkg/kube" "k8s.io/helm/pkg/proto/hapi/services" @@ -155,6 +157,10 @@ func start() { logger.Fatalf("Could not create server TLS configuration: %v", err) } opts = append(opts, grpc.Creds(credentials.NewTLS(cfg))) + opts = append(opts, grpc.KeepaliveParams(keepalive.ServerParameters{ + MaxConnectionIdle: 10 * time.Minute, + // If needed, we can configure the max connection age + })) } rootServer = tiller.NewServer(opts...)