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

Automated cherry pick of #11850 #12055

Conversation

tangcong
Copy link
Contributor

Cherry pick of #11850 on release-3.4.

#11850: clientv3: cancel watches proactively on client context

@tangcong tangcong marked this pull request as draft June 23, 2020 02:47
@tangcong tangcong force-pushed the automated-cherry-pick-of-#11850-origin-release-3.4 branch from b0678d7 to 44644c3 Compare June 23, 2020 11:37
Currently, watch cancel requests are only sent to the server after a
message comes through on a watch where the client has cancelled. This
means that cancelled watches that don't receive any new messages are
never cancelled; they persist for the lifetime of the client stream.
This has negative connotations for locking applications where a watch
may observe a key which might never change again after cancellation,
leading to many accumulating watches on the server.

By cancelling proactively, in most cases we simply move the cancel
request to happen earlier, and additionally we solve the case where the
cancel request would never be sent.

Fixes etcd-io#9416
Heavy inspiration drawn from the solutions proposed there.
@tangcong tangcong force-pushed the automated-cherry-pick-of-#11850-origin-release-3.4 branch from 44644c3 to 36452a1 Compare June 23, 2020 11:51
@tangcong tangcong marked this pull request as ready for review June 24, 2020 15:50
@tangcong
Copy link
Contributor Author

cc @jackkleeman @gyuho
fmt check is failed. i have submitted a pr #12066 to fix it.
integration check is also failed. i can not reproduce it. local integration test is ok.
image

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

Successfully merging this pull request may close these issues.

3 participants