Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

servenv: add new keepalive flag to grpc server #4737

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

derekperkins
Copy link
Member

This PR adds a single grpc configuration flag for keepalive enforcement policy: PermitWithoutStream:. It defaults to false, the same as previous behavior. The purpose is to prevent potential zombie connections from vtgate to vttablet on intermittently active streams. We're already setting this to be true by default on the client side here:

kp := keepalive.ClientParameters{
// After a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.
Time: *keepaliveTime,
// After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that
// the connection is closed. (This will eagerly fail inflight grpc requests even if they don't have timeouts.)
Timeout: *keepaliveTimeout,
PermitWithoutStream: true,
}

That setting doesn't take effect if it isn't also enabled server side.

// If true, server allows keepalive pings even when there are no active
// streams(RPCs). If false, and client sends ping when there are no active
// streams, server will send GOAWAY and close the connection.
https://godoc.org/google.golang.org/grpc/keepalive#EnforcementPolicy

GRPCKeepAliveEnforcementPolicyPermitWithoutStream - defaults to false, the same as previous behavior

Signed-off-by: Derek Perkins <[email protected]>
Copy link
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.

That is a long flag name :)

@sougou sougou merged commit ae47a53 into vitessio:master Mar 19, 2019
@derekperkins derekperkins deleted the grpc-keepalive-flag branch March 23, 2019 03:10
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.

2 participants