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

doc: update keepalive ClientParameters doc about doubling the interval upon GOAWAY #7469

Merged
merged 6 commits into from
Aug 20, 2024

Conversation

menghanl
Copy link
Contributor

@menghanl menghanl commented Aug 1, 2024

Add to the godoc the behavior that the client doubles the keepalive ping interval when GOAWAY is received due to too-many-pings.

And link to the design doc.

RELEASE NOTES: N/A

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.38%. Comparing base (6fa393c) to head (7293606).
Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7469   +/-   ##
=======================================
  Coverage   81.38%   81.38%           
=======================================
  Files         354      354           
  Lines       27080    27080           
=======================================
  Hits        22040    22040           
  Misses       3831     3831           
  Partials     1209     1209           

see 16 files with indirect coverage changes

Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

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

While you are here, should we also try and fix the code where we check if Time is less than 10s and if so, set it to 10s. We should check for 0s explicitly there and probably not set it to 10s if the value is 0s? This will be a behavior change though. @dfawley

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

I'm undecided on the 0s vs. 10s. vs infinity question so far.

The question to me is: if the user actually sets keepalive, why would they want it to have an infinite Time? Is there ever a reason to do that? If not, then the default being 10s (when configuring keepalive) seems pretty reasonable to me.

If we keep the behavior the same, we should update the comment, though, to say "keepalives are disabled by default, but the default value for this field is 10s".

keepalive/keepalive.go Outdated Show resolved Hide resolved
keepalive/keepalive.go Outdated Show resolved Hide resolved
Copy link
Contributor Author

@menghanl menghanl left a comment

Choose a reason for hiding this comment

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

Updated. PTAL

@dfawley dfawley self-assigned this Aug 6, 2024
@dfawley dfawley added the Type: Documentation Documentation or examples label Aug 6, 2024
@dfawley dfawley added this to the 1.66 Release milestone Aug 6, 2024
@arvindbr8 arvindbr8 requested a review from dfawley August 8, 2024 23:13
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

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

@@ -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

@easwars easwars merged commit 1e2bb71 into grpc:master Aug 20, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Documentation or examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants