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

clientv3: handle context error at beginning in KeepAlive #9036

Closed
wants to merge 2 commits into from

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Dec 18, 2017

No description provided.

@gyuho gyuho requested a review from xiang90 December 18, 2017 18:56
@codecov-io
Copy link

codecov-io commented Dec 18, 2017

Codecov Report

Merging #9036 into master will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
clientv3/lease.go 95.13% <66.66%> (+2.35%) ⬆️
pkg/fileutil/purge.go 73.68% <0%> (-7.9%) ⬇️
clientv3/leasing/cache.go 87.77% <0%> (-3.34%) ⬇️
lease/leasehttp/http.go 62.5% <0%> (-2.95%) ⬇️
etcdserver/api/v3rpc/lease.go 83.82% <0%> (-2.95%) ⬇️
proxy/grpcproxy/watch.go 91.92% <0%> (-1.87%) ⬇️
rafthttp/msgappv2_codec.go 71.3% <0%> (-1.74%) ⬇️
rafthttp/peer.go 90.22% <0%> (-1.51%) ⬇️
pkg/adt/interval_tree.go 87.98% <0%> (-1.21%) ⬇️
clientv3/leasing/kv.go 89.93% <0%> (-1.01%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecbd1ae...2fed272. Read the comment docs.

@@ -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():
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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>
@gyuho
Copy link
Contributor Author

gyuho commented Dec 19, 2017

Talked with @fanminshi. This might confuse users. Could go into 4.0 with other keepalive interface change (#7866).

@gyuho gyuho added this to the v4.0.0 milestone Dec 19, 2017
@stale
Copy link

stale bot commented Apr 6, 2020

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.

@stale stale bot added the stale label Apr 6, 2020
@stale stale bot closed this Apr 27, 2020
@gyuho gyuho deleted the keepalive-ctx branch June 3, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants