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

Determine final NameResolver to LoadBalancer communication #4302

Open
ejona86 opened this issue Apr 4, 2018 · 1 comment
Open

Determine final NameResolver to LoadBalancer communication #4302

ejona86 opened this issue Apr 4, 2018 · 1 comment
Assignees
Milestone

Comments

@ejona86
Copy link
Member

ejona86 commented Apr 4, 2018

Alluded to in #4137 (comment) . The biggest issue is probably how Java allows a list of lists of addresses. This is different than the other implementations. We need to come to a cross-language agreement about whether list of lists is necessary.

But we also need to design the final solution for how proxy information should be plumbed from the NameResolver through the LoadBalancer into Subchannel. That will remove PairSocketAddress or stabilize it (with a better name!).

CC @zhangkun83

@ejona86
Copy link
Member Author

ejona86 commented Jun 27, 2018

This issue is no longer impacted by the design of proxy information.

@zhangkun83 and I discussed how proxy will be handled. We feel good about having a ProxySocketAddress that wraps a SocketAddress (typically an InetSocketAddress). We're also comfortable doing this strategy in other cases where the extra information is required to properly use the address.

The case that isn't handled well is when this additional information is optional, because that forces all downstream consumers of the FooSocketAddress to understand it, which isn't really acceptable. Right now, we believe "this case is unlikely" because each address in an EAG is supposed to be pretty equivalent (like two addresses to the same host) and it seems really weird to have optional information at this level. If that turns out to be incorrect, we could introduce an OptionalInfoSocketAddress interface that has a getNestedSocketAddress() which would allow downstream consumers to unwrap the address independent of whatever new optional information is deemed necessary. That would be sub-optimal, but quite good as a fall-back when our design assumptions fail.

The "each address in an EAG is supposed to be pretty equivalent" is a false assumption today, as PickFirstLoadBalancer merges multiple EAGs into a single EAG to pass to LoadBalancer.Helper.createSubchannel(EquivalentAddressGroup addrs, Attributes attrs). This will be solved by avoiding the merge with a new method for the purpose: LoadBalancer.Helper.createSubchannel(List<EquivalentAddressGroup> addrs, Attributes attrs).

ejona86 added a commit to ejona86/grpc-java that referenced this issue Jun 29, 2018
This avoids the needs to flatten to EAGs for cases like PickFirst,
making the Attributes in EAGs able to be used in communication with
core. See grpc#4302 for some discussion on the topic.
ejona86 added a commit that referenced this issue Jul 2, 2018
This avoids the needs to flatten to EAGs for cases like PickFirst,
making the Attributes in EAGs able to be used in communication with
core. See #4302 for some discussion on the topic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant