-
Notifications
You must be signed in to change notification settings - Fork 3.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
xDS: implement ADS stream flow control mechanism #10674
Conversation
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 seems a bit error-prone and annoying. Would it be nicer to pass an Executor (syncContext) when registering the watch, so that completing the future could be done within XdsClient?
6adfd3e
to
169dacc
Compare
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.
Still looking, but sending what I have. I need to stare at the MIN_VALUE stuff longer.
ceba733
to
e9f81f6
Compare
8f6143b
to
176afae
Compare
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.
Sending what I have.
I made a comment and you fixed it before I could send it!
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.
The code looks good, although it really deserves a test. We can talk to figure out easiest approach to a test.
@@ -650,13 +655,20 @@ void onData(ParsedResource<T> parsedResource, String version, long updateTime) { | |||
resourceDeletionIgnored = false; | |||
} | |||
if (!Objects.equals(oldData, data)) { | |||
for (ResourceWatcher<T> watcher : watchers) { | |||
notifyWatcher(watcher, data); | |||
for (ResourceWatcher<T> watcher : watchers.keySet()) { |
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.
Consider using entrySet()
, so you don't have to look up the value. Ditto below.
} | ||
|
||
DiscoveryRpcCall call = resourceDiscoveryCalls.poll(); | ||
call.verifyRequest(type, Collections.singletonList(name), "", "", NODE); |
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.
poll could return null if resourceDiscoveryCalls is empty. It would be better to do an explicit check with an explanatory message than get an NPE.
This reverts commit 0a704a5.
fix grpc/grpc#34099
@ejona86 early feedback about the overall shape would be great, tests needs to be cleaned up.