-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Allow to send empty subscription and update version afterward #11264
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
Changes from 5 commits
ef37158
133de5e
037cdef
9ed7e27
3da29af
041809d
b61742c
c8fa46c
2b636c2
09f18f1
c84946a
c2da8a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -281,7 +281,7 @@ public <T extends ResourceUpdate> void cancelXdsResourceWatch(XdsResourceType<T> | |
@SuppressWarnings("unchecked") | ||
public void run() { | ||
ResourceSubscriber<T> subscriber = | ||
(ResourceSubscriber<T>) resourceSubscribers.get(type).get(resourceName);; | ||
(ResourceSubscriber<T>) resourceSubscribers.get(type).get(resourceName); | ||
subscriber.removeWatcher(watcher); | ||
if (!subscriber.isWatched()) { | ||
subscriber.cancelResourceWatch(); | ||
|
@@ -291,7 +291,6 @@ public void run() { | |
} | ||
if (resourceSubscribers.get(type).isEmpty()) { | ||
resourceSubscribers.remove(type); | ||
subscribedResourceTypeUrls.remove(type.typeUrl()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We definitely want to clean up the resource. Nonces are per-resource? Then it seems when the client starts watches again the server should notice the lack of nonce. The issue might be instead that we aren't cleaning up Note that maybe we should do the new I/O you are causing in this PR, but maybe we allow sending the ACK even when subscribedResourceTypeUrls lacks the type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of removing line 294, have it call a cleanup method on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds good to me. @lujiajing1126, if it turns out to be annoying to make that change, tell us and we'll see how we can help. Also, if you think that wouldn't fully address what you noticed, say so. I don't fully understand "adjustResourceSubscription issue;" it just looks like the same nonce issue to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Also, if you are uncertain about the changes, you can send them out before you update/fix any tests. A sort of early review.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree with both of you. Instead of creating a cleanup method, I've merged cleanup logic into the existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. Exactly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I tried to fix this issue based on the comment (without modifying the test cases) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please modify the failing test case to expect the nonce to be reset. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Test case has been fixed with some additional helper to access the underlying private/package-private fields |
||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.