-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
clientv3: handle context error at beginning in KeepAlive #9036
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9036 +/- ##
==========================================
- Coverage 76.13% 76.11% -0.02%
==========================================
Files 359 359
Lines 29841 29845 +4
==========================================
- Hits 22720 22718 -2
- Misses 5552 5555 +3
- Partials 1569 1572 +3
Continue to review full report at Codecov.
|
@@ -244,6 +244,11 @@ func (l *lessor) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAl | |||
l.mu.Unlock() | |||
close(ch) | |||
return ch, ErrKeepAliveHalted{Reason: err} | |||
case <-ctx.Done(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just for early termination on ctx.done right? I think old code is still correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is for early termination. Old code won't return context error for early context cancel/timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No error is returned--only the keepalive channel is closed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, will this breaks api in someway? since this code changes the behavior of api?
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Talked with @fanminshi. This might confuse users. Could go into 4.0 with other keepalive interface change (#7866). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
No description provided.