Skip to content

Commit

Permalink
Close connections after timeout (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovromazgon authored Dec 22, 2022
1 parent b6214bb commit af8412b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/conduit/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/stats"
"gopkg.in/tomb.v2"

Expand Down Expand Up @@ -279,6 +280,10 @@ func (r *Runtime) serveGRPCAPI(ctx context.Context, t *tomb.Tomb) (net.Addr, err
grpcutil.LoggerUnaryServerInterceptor(r.logger),
),
grpc.StatsHandler(r.newGrpcStatsHandler()),
grpc.KeepaliveParams(keepalive.ServerParameters{
MaxConnectionAge: time.Minute,
MaxConnectionAgeGrace: time.Second * 30,
}),
)

pipelineAPIv1 := api.NewPipelineAPIv1(r.Orchestrator.Pipelines)
Expand Down

0 comments on commit af8412b

Please sign in to comment.