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

core, netty, okhttp: implement new logic for nameResolverFactory API in channelBuilder #10590

Merged
merged 10 commits into from
Nov 3, 2023

Conversation

sanjaypujare
Copy link
Contributor

fix ManagedChannelImpl to use NameResolverRegistry instead of NameResolverFactory fix the ManagedChannelImplBuilder and remove nameResolverFactory

@sanjaypujare sanjaypujare requested a review from ejona86 October 4, 2023 23:34
…in channelBuilder

fix ManagedChannelImpl to use NameResolverRegistry instead of NameResolverFactory
fix the ManagedChannelImplBuilder and remove nameResolverFactory
@sanjaypujare sanjaypujare marked this pull request as ready for review October 9, 2023 06:31
api/src/main/java/io/grpc/NameResolverRegistry.java Outdated Show resolved Hide resolved
@@ -159,6 +160,22 @@ static List<Class<?>> getHardCodedClasses() {
return Collections.unmodifiableList(list);
}

public static NameResolverProvider getNameResolverProvider(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to pass in supported address types here and let this code do the verification? That would then mirror ManagedChannelRegistry. We might need a "null means all addresses are supported" though...

netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java Outdated Show resolved Hide resolved
netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java Outdated Show resolved Hide resolved
netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java Outdated Show resolved Hide resolved
@ejona86 ejona86 requested a review from temawi October 10, 2023 05:40
@ejona86
Copy link
Member

ejona86 commented Oct 10, 2023

FYI @markb74, we're adding in checks to notice earlier if the NameResolver returns addresses that aren't supported by the transport. A mis-match was causing pretty confusing errors. I think we should be able to migrate any binder stuff easily, but if not, we should be able to punch holes to disable the check.

@sanjaypujare
Copy link
Contributor Author

Addressed all comments. PTAL

@sanjaypujare
Copy link
Contributor Author

Friendly ping @ejona86

Actually creating the name resolver is new delayed to the end of
ManagedChannelImpl.getNameResolver; we don't want to call into the name
resolver to determine if we should use the name resolver.

Added getDefaultScheme() to NameResolverRegistry to avoid needing
NameResolver.Factory.
@ejona86
Copy link
Member

ejona86 commented Oct 31, 2023

@sanjaypujare, I just pushed a commit. Take a look at it and tell me how you feel about it.

Copy link
Contributor Author

@sanjaypujare sanjaypujare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the last commit from @ejona86 : looks good. Just have 2 comments. Will discuss offline and get them resolved

@sanjaypujare sanjaypujare merged commit 15fc70b into grpc:master Nov 3, 2023
6 checks passed
@sanjaypujare sanjaypujare deleted the resolver-fix branch November 3, 2023 16:58
YifeiZhuang added a commit to YifeiZhuang/grpc-java that referenced this pull request Nov 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 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.

2 participants