-
Notifications
You must be signed in to change notification settings - Fork 10.1k
grpcproxy: add support for WatchRequest_ProgressRequest #19711
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
base: main
Are you sure you want to change the base?
grpcproxy: add support for WatchRequest_ProgressRequest #19711
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alexandrevilain The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @alexandrevilain. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
cc944d6
to
4b202ef
Compare
4b202ef
to
8b9dd9a
Compare
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
... and 47 files with indirect coverage changes @@ Coverage Diff @@
## main #19711 +/- ##
==========================================
+ Coverage 65.98% 68.76% +2.78%
==========================================
Files 421 421
Lines 35857 35878 +21
==========================================
+ Hits 23659 24673 +1014
+ Misses 10791 9766 -1025
- Partials 1407 1439 +32 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
/retest |
8b9dd9a
to
add9f2b
Compare
/retest |
add9f2b
to
3c48c1f
Compare
server/proxy/grpcproxy/watch.go
Outdated
// Enable the progress notify on the watcher, otherwise the send() | ||
// method may drop progress events. | ||
if !w.progress { | ||
w.progress = true |
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.
This is not the same progress notification source. In etcd there are two ways to get progress notification:
- Server configures a periodic progress notification period and client requests getting periodic notification. For example if it's configured for 5s, and there was no normal event in watch for 5s, server should send a notification to watch.
- Client requested notification, client can at any moment request a notification and server should imminently give a response about a watch progress.
This PR mixes those two, where it configures a grpc proxy to response to requested notification by enabling periodic notification.
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.
Thanks for the explanation @serathius!
Just to clarify, are you saying I shouldn't permanently enable progress notifications on the watcher?
Instead, should I implement something like a one-time toggle on the watcher side to allow a notification for the next request only?
So, when the proxy receives a new WatchRequest_ProgressRequest, it would set this toggle to true and call RequestProgress on the server.
Then, once the proxy receives the progress notification, it sends it to the client and resets the toggle back to false.
Is that the intended behavior?
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.
Just to clarify, are you saying I shouldn't permanently enable progress notifications on the watcher?
Instead, should I implement something like a one-time toggle on the watcher side to allow a notification for the next request only?
Yes
So, when the proxy receives a new WatchRequest_ProgressRequest, it would set this toggle to true and call RequestProgress on the server.
Then, once the proxy receives the progress notification, it sends it to the client and resets the toggle back to false.
Is that the intended behavior?
I haven't dive into what exactly the toggle does, but my initial thinking is that grpcproxy should just proxy WatchRequest_ProgressRequest request.
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.
Thanks.
I've reworked the code to support both types of progress notifications.
Let me know if this looks better.
3c48c1f
to
26c34e3
Compare
Signed-off-by: alexandre.vilain <[email protected]>
26c34e3
to
63e4f0b
Compare
Fixes #19710