xDS: implement ADS stream flow control mechanism#10674
xDS: implement ADS stream flow control mechanism#10674YifeiZhuang merged 14 commits intogrpc:masterfrom
Conversation
ejona86
left a comment
There was a problem hiding this comment.
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
ejona86
left a comment
There was a problem hiding this comment.
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
ejona86
left a comment
There was a problem hiding this comment.
Sending what I have.
I made a comment and you fixed it before I could send it!
ejona86
left a comment
There was a problem hiding this comment.
The code looks good, although it really deserves a test. We can talk to figure out easiest approach to a test.
| 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.
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.
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.