Skip to content

Commit 4f91458

Browse files
committed
Remove MaxConnectionAge overflow mitigation
Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
1 parent c7deb2e commit 4f91458

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

vms/rpcchainvm/grpcutils/server.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,6 @@ const (
2525
// of Timeout and if no activity is seen even after that the connection is
2626
// closed. grpc-go default 20s
2727
defaultServerKeepAliveTimeout = 20 * time.Second
28-
// Duration for the maximum amount of time a http2 connection can exist
29-
// before sending GOAWAY. Internally in gRPC a +-10% jitter is added to
30-
// mitigate retry storms.
31-
defaultServerMaxConnectionAge = 10 * time.Minute
32-
// After MaxConnectionAge, MaxConnectionAgeGrace specifies the amount of time
33-
// between when the server sends a GOAWAY to the client to initiate graceful
34-
// shutdown, and when the server closes the connection.
35-
//
36-
// The server expects that this grace period will allow the client to complete
37-
// any ongoing requests, after which it will forcefully terminate the connection.
38-
// If a request takes longer than this grace period, it will *fail*.
39-
// We *never* want an RPC to live longer than this value.
40-
//
41-
// invariant: Any value < 1 second will be internally overridden by gRPC.
42-
defaultServerMaxConnectionAgeGrace = math.MaxInt64
4328
)
4429

4530
var DefaultServerOptions = []grpc.ServerOption{
@@ -51,10 +36,8 @@ var DefaultServerOptions = []grpc.ServerOption{
5136
PermitWithoutStream: defaultPermitWithoutStream,
5237
}),
5338
grpc.KeepaliveParams(keepalive.ServerParameters{
54-
Time: defaultServerKeepAliveInterval,
55-
Timeout: defaultServerKeepAliveTimeout,
56-
MaxConnectionAge: defaultServerMaxConnectionAge,
57-
MaxConnectionAgeGrace: defaultServerMaxConnectionAgeGrace,
39+
Time: defaultServerKeepAliveInterval,
40+
Timeout: defaultServerKeepAliveTimeout,
5841
}),
5942
}
6043

0 commit comments

Comments
 (0)