Skip to content
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

Merged
merged 14 commits into from
Dec 16, 2023

Conversation

YifeiZhuang
Copy link
Contributor

fix grpc/grpc#34099

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

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?

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.

xds/src/main/java/io/grpc/xds/XdsClientImpl.java Outdated Show resolved Hide resolved
xds/src/main/java/io/grpc/xds/ControlPlaneClient.java Outdated Show resolved Hide resolved
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!

xds/src/main/java/io/grpc/xds/XdsClient.java Outdated Show resolved Hide resolved
xds/src/main/java/io/grpc/xds/XdsClientImpl.java Outdated Show resolved Hide resolved
xds/src/main/java/io/grpc/xds/XdsClientImpl.java Outdated Show resolved Hide resolved
xds/src/main/java/io/grpc/xds/XdsClientImpl.java Outdated Show resolved Hide resolved
xds/src/main/java/io/grpc/xds/XdsClientImpl.java Outdated Show resolved Hide resolved
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.

@@ -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()) {
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.

xds/src/test/java/io/grpc/xds/XdsClientImplTestBase.java Outdated Show resolved Hide resolved
}

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
14 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xDS: implement ADS stream flow control mechanism
3 participants