Skip to content

Commit

Permalink
fix(grpcproxy): add GRPCKeepAliveEnforcementMinimum (#16567)
Browse files Browse the repository at this point in the history
the absence of the setting potentially causes ENHANCE_YOUR_CALM

Signed-off-by: phanama <yudiandreanp@gmail.com>
Co-authored-by: phanama <yudiandreanp@gmail.com>
  • Loading branch information
todaywasawesome and phanama authored Dec 7, 2023
1 parent c3f55ea commit 1b69ce6
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 1b69ce6

Please sign in to comment.