Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion keepalive/keepalive.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@ import (
type ClientParameters struct {
// 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.
// If set below 10s, a minimum value of 10s will be used instead.
// If set below 10s (including 0), a minimum value of 10s will be used
Copy link
Member

Choose a reason for hiding this comment

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

The "including 0" is probably not needed if we get rid of the comment below as mentioned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// instead.
//
// Note that gRPC servers have a default EnforcementPolicy.MinTime of 5
// minutes (which means the client shouldn't ping more frequently than every
// 5 minutes).
//
// Though not ideal, it's not a strong requirement for Time to be less than
// EnforcementPolicy.MinTime. Time will automatically double if the server
// disconnects due to its enforcement policy.
//
// For more details, see
// https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
Time time.Duration // The current default value is infinity.
Copy link
Member

Choose a reason for hiding this comment

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

Can you delete this comment, please? Explaining the behavior can be done via the existing text above and in grpc.WithKeepaliveParams (which ideally would be updated as part of this cleanup, if you don't mind, to say something like "Keepalive is disabled by default" or "Keepalive pings are disabled by default").

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// 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
Expand Down