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: document context.Context parameter to streaming APIs #8993

Closed
gyuho opened this issue Dec 8, 2017 · 3 comments
Closed

clientv3: document context.Context parameter to streaming APIs #8993

gyuho opened this issue Dec 8, 2017 · 3 comments
Assignees

Comments

@gyuho
Copy link
Contributor

gyuho commented Dec 8, 2017

Related to #8980.

We haven't documented how our stream APIs work with client's contexts.

https://github.com/coreos/etcd/blob/e3da56a8dfb88c7ee8f6c282c986fb5154700910/clientv3/watch.go#L44-L53

https://github.com/coreos/etcd/blob/e3da56a8dfb88c7ee8f6c282c986fb5154700910/clientv3/lease.go#L116-L117

https://github.com/coreos/etcd/blob/e3da56a8dfb88c7ee8f6c282c986fb5154700910/clientv3/maintenance.go#L57-L58

Would cancelling the context close the watch stream? What if the context timeouts? If the stream is kept open, what is the retry policy? What happens to the underlying io.ReadCloser when the context gets cancelled?

Also

https://github.com/coreos/etcd/blob/b48cf77abb78755c8654eb8da61bc90a32802e7d/clientv3/concurrency/session.go#L132-L141

@gyuho gyuho changed the title clientv3: document context.Context parameter to streaming API clientv3: document context.Context parameter to streaming APIs Dec 8, 2017
@gyuho gyuho self-assigned this Dec 14, 2017
@gyuho
Copy link
Contributor Author

gyuho commented Dec 18, 2017

/cc @fanminshi

Another reference: d59f6c1

@gyuho
Copy link
Contributor Author

gyuho commented Dec 21, 2017

WithContext is already documented well. Closing!

@gyuho gyuho closed this as completed Dec 21, 2017
@xiang90
Copy link
Contributor

xiang90 commented Dec 21, 2017

@gyuho good job on this one!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants