Skip to content

Commit

Permalink
Remove MaxConnectionAge overflow mitigation
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
  • Loading branch information
hexfusion committed Jun 19, 2023
1 parent c7deb2e commit 4f91458
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions vms/rpcchainvm/grpcutils/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ const (
// of Timeout and if no activity is seen even after that the connection is
// closed. grpc-go default 20s
defaultServerKeepAliveTimeout = 20 * time.Second
// Duration for the maximum amount of time a http2 connection can exist
// before sending GOAWAY. Internally in gRPC a +-10% jitter is added to
// mitigate retry storms.
defaultServerMaxConnectionAge = 10 * time.Minute
// After MaxConnectionAge, MaxConnectionAgeGrace specifies the amount of time
// between when the server sends a GOAWAY to the client to initiate graceful
// shutdown, and when the server closes the connection.
//
// The server expects that this grace period will allow the client to complete
// any ongoing requests, after which it will forcefully terminate the connection.
// If a request takes longer than this grace period, it will *fail*.
// We *never* want an RPC to live longer than this value.
//
// invariant: Any value < 1 second will be internally overridden by gRPC.
defaultServerMaxConnectionAgeGrace = math.MaxInt64
)

var DefaultServerOptions = []grpc.ServerOption{
Expand All @@ -51,10 +36,8 @@ var DefaultServerOptions = []grpc.ServerOption{
PermitWithoutStream: defaultPermitWithoutStream,
}),
grpc.KeepaliveParams(keepalive.ServerParameters{
Time: defaultServerKeepAliveInterval,
Timeout: defaultServerKeepAliveTimeout,
MaxConnectionAge: defaultServerMaxConnectionAge,
MaxConnectionAgeGrace: defaultServerMaxConnectionAgeGrace,
Time: defaultServerKeepAliveInterval,
Timeout: defaultServerKeepAliveTimeout,
}),
}

Expand Down

0 comments on commit 4f91458

Please sign in to comment.