Skip to content

Allow overriding of the default keepalive server-side enforcement policy min time#4130

Merged
sougou merged 3 commits intovitessio:masterfrom
tinyspeck:fix-grpcserver-ka-enforcement-policy
Aug 12, 2018
Merged

Allow overriding of the default keepalive server-side enforcement policy min time#4130
sougou merged 3 commits intovitessio:masterfrom
tinyspeck:fix-grpcserver-ka-enforcement-policy

Conversation

@zmagg
Copy link
Copy Markdown
Contributor

@zmagg zmagg commented Aug 10, 2018

Allow setting the keepalive server-side enforcement policy min time, so that the server doesn't preemptively close connections due to setting our client keepalive to a more aggressive value than the allowed server policy.

Signed-off-by: Maggie Zhou mzhou@slack-corp.com

the server doesn't preemptively close connections due to our client
keepalive being more aggressive than the allowed server policy.

Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>

// EnforcementPolicy MinTime that sets the keepalive enforcement policy on the server.
// This is the minimum amount of time a client should wait before sending a keepalive ping.
GRPCEnforcementPolicyMinTime = flag.Duration("grpc_enforcement_min_time", 5*time.Minute, "grpc server minimum keepalive time")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I clicked approve a bit too soon :)

IMO we should be clearer that this has to do with keepalives, so I would change the flag name to grpc_keepalive_enforcement_policy_min_time and the variable name to the corresponding camelCase.


// EnforcementPolicy MinTime that sets the keepalive enforcement policy on the server.
// This is the minimum amount of time a client should wait before sending a keepalive ping.
GRPCEnforcementPolicyMinTime = flag.Duration("grpc_enforcement_min_time", 5*time.Minute, "grpc server minimum keepalive time")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call this grpc_server_... to be consistent with all the other flags.

Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
Copy link
Copy Markdown
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also need to set the PermitWithoutStream flag? If so, you may have to spin up a new PR. I'll merge this.

@sougou sougou merged commit 6b4da9f into vitessio:master Aug 12, 2018
@zmagg
Copy link
Copy Markdown
Contributor Author

zmagg commented Aug 14, 2018

@sougou I don't believe we need PermitWithoutStream, as there should always be streams between the gate/tablet that we're trying to manage with KeepAlives here. I'll open another PR if that turns out to be wrong. 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants