-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Add a Code based member for cancel reason in WatchResponse #15058
Comments
@lavacat Yes I'm planning to work on, but if other people can work on this issue, it's fine for me. |
a new optional (since old servers won't send it) code field the client reacts to if present seems like a minimal and safe approach |
Agree. It would be something like below,
|
@mitake if you don't mind, I'll work on this task, since we have an internal use case for it and we also might contribute retry logic to jetcd client. |
@lavacat Thanks a lot! If you can work on it, it's really helpful. |
@mitake @ahrtr I've tried implementing reason codes, but it feels cumbersome to have both reasonCode and cancelReason string. Here are some concerns:
How about we add I've added both |
My immediate feeling is adding |
I also feel |
I think adding field something like Note Kubernetes describes working against a storage layer that implements the etcd wire protocol. FYI. kubernetes/kubernetes#114403 (comment) Even we only add In summary, if we follow the direction of adding field something like |
@mitake main problem with codes is that they add extra duplication to exposed From client perspective the only actionable use-case is I'm open to reasonCode route, but just want to call out extra boilerplate it will add. |
Problem: client relies on string value of CancelReason to determine if watcher should be retried. This is too fragile. See etcd-io#14992 Solution: add explicit `retry` flag fixes: etcd-io#15058 Signed-off-by: Bogdan Kanivets <[email protected]>
Problem: client relies on string value of CancelReason to determine if watcher should be retried. This is too fragile. See etcd-io#14992 Solution: add explicit `retry` flag fixes: etcd-io#15058 Signed-off-by: Bogdan Kanivets <[email protected]>
cc @logicalhan |
I don't treat couple of comments as a proper agreement on what we should do next, especially when the proposal changed mid way. Let's at least to semi-formal enhancement proposal before moving forward. Please write a dedicated comment that will include all relevant information about the current proposal. How exactly you want to change proto, how you expect it will be used by users of new client, what are the alternatives, why your solution is better than alternatives. If you want to propose a backport like in #15253, there should a clear in proposal which should include asses impact of backport. There should be clear agreement from all stakeholders that this is best way to move forward. |
Sounds good. I think this requires google doc to summarize everything and allow folks to comment. I'll put it together. |
@chaochn47 I've created a proposal. I'd like to polish but didn't have time. Feel free to comment what you'd like to see there. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
@mitake yes, I'll work on proposal this week or next. Agreed about finishing it before 3.6. Would appreciate your review. |
@lavacat Thanks a lot for working on this! I think proposal 1 for 3.5 or earlier and proposal 3 for 3.6+ for keeping compatibility and simplifying the usage would be good. |
hi @lavacat , do you have updates? Please let me know if I can help. |
See the rough summary/plan in #17384 (comment) Workarounds for the issue (use only one of the following two solutions):
|
What would you like to be added?
Currently
WatchResponse
message has a string type member CancelReason. The member is used for storing an error which happened during watch.It's better to add a new Code based member for representing an error in the watch API.
Why is this needed?
Using the existing member for error handling code isn't good because of fragility and hard to track behavior of the etcd wire protocol.
See also:
The text was updated successfully, but these errors were encountered: