Skip to content

Conversation

YifeiZhuang
Copy link
Member

fix grpc/grpc#34099

@ejona86 early feedback about the overall shape would be great, tests needs to be cleaned up.

@YifeiZhuang YifeiZhuang requested a review from ejona86 November 16, 2023 02:28
Copy link
Member

@ejona86 ejona86 left a 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?

@YifeiZhuang YifeiZhuang requested a review from ejona86 November 20, 2023 21:51
Copy link
Member

@ejona86 ejona86 left a 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.

Copy link
Member

@ejona86 ejona86 left a 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!

Copy link
Member

@ejona86 ejona86 left a 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.

if (!Objects.equals(oldData, data)) {
for (ResourceWatcher<T> watcher : watchers) {
notifyWatcher(watcher, data);
for (ResourceWatcher<T> watcher : watchers.keySet()) {
Copy link
Member

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);
Copy link
Contributor

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.

@YifeiZhuang YifeiZhuang merged commit 0a704a5 into grpc:master Dec 16, 2023
@YifeiZhuang YifeiZhuang deleted the flow-control branch December 16, 2023 19:17
YifeiZhuang added a commit to YifeiZhuang/grpc-java that referenced this pull request Dec 27, 2023
YifeiZhuang added a commit that referenced this pull request Dec 28, 2023
* Revert "xds: fix flow control test failure (#10773)" This reverts commit f67ec2e. * Revert "xDS: implement ADS stream flow control mechanism (#10674)" This reverts commit 0a704a5.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants