Skip to content

Commit

Permalink
fix(grpcproxy): add missing GRPCKeepAliveEnforcementMinimum (#15708) (#…
Browse files Browse the repository at this point in the history
…16576)

the absence of the setting potentially causes ENHANCE_YOUR_CALM

Signed-off-by: phanama <[email protected]>
Signed-off-by: Maxime Brunet <[email protected]>
Co-authored-by: Yudi A Phanama <[email protected]>
Co-authored-by: Dan Garfield <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2023
1 parent 0e65b84 commit ab3b2e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/apiclient/grpcproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import (

"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"

"github.com/argoproj/argo-cd/v2/common"
argocderrors "github.com/argoproj/argo-cd/v2/util/errors"
argoio "github.com/argoproj/argo-cd/v2/util/io"
"github.com/argoproj/argo-cd/v2/util/rand"
Expand Down Expand Up @@ -112,6 +114,11 @@ func (c *client) startGRPCProxy() (*grpc.Server, net.Listener, error) {
}
proxySrv := grpc.NewServer(
grpc.ForceServerCodec(&noopCodec{}),
grpc.KeepaliveEnforcementPolicy(
keepalive.EnforcementPolicy{
MinTime: common.GRPCKeepAliveEnforcementMinimum,
},
),
grpc.UnknownServiceHandler(func(srv interface{}, stream grpc.ServerStream) error {
fullMethodName, ok := grpc.MethodFromServerStream(stream)
if !ok {
Expand Down

0 comments on commit ab3b2e7

Please sign in to comment.