-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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: document context to "KeepAlive" API #9023
Conversation
clientv3/lease.go
Outdated
// When the context "ctx" is canceled or timed out, | ||
// returned "LeaseKeepAliveResponse" channel is closed, | ||
// and "LeaseKeepAliveResponse" from this closed channel is nil. | ||
// If the context is "context.Background/TODO", |
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.
probably wont say anything about the TODO one. line 116 already explains it. we might want to talk about when an error can be returned though.
clientv3/lease.go
Outdated
@@ -114,6 +114,9 @@ type Lease interface { | |||
Leases(ctx context.Context) (*LeaseLeasesResponse, error) | |||
|
|||
// KeepAlive keeps the given lease alive forever. | |||
// If the context "ctx" is canceled or timed out, | |||
// returned "LeaseKeepAliveResponse" channel is closed, | |||
// and "LeaseKeepAliveResponse" from this closed channel is nil. | |||
KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) |
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.
we should document about the error? for example, what happens if the client failed to send keepalive for a few minutes, and when it reconnected the lease is already expired?
Codecov Report
@@ Coverage Diff @@
## master #9023 +/- ##
=========================================
+ Coverage 76.12% 76.22% +0.1%
=========================================
Files 359 359
Lines 29838 29838
=========================================
+ Hits 22715 22745 +30
+ Misses 5548 5529 -19
+ Partials 1575 1564 -11
Continue to review full report at Codecov.
|
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
lgtm |
Address #8993.