Skip to content

Conversation

@carl-mastrangelo
Copy link
Contributor

@carl-mastrangelo carl-mastrangelo commented Dec 9, 2017

This is part one of handling service config, and also enabled grpclb to work. I manually tested this with some complex DNS data, but I dont have many unit tests because we dont have a dummy DNS server.

Handling or the SRV records logs failures and tries to keep going.

This can be enabled by setting io.grpc.internal.DnsNameResolverProvider.enable_jndi to true. This feature enables https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md


@VisibleForTesting
static boolean enableJndi = false;
static boolean enableJndi = true;
Copy link
Member

Choose a reason for hiding this comment

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

We should keep this off until it is stable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put it behind a flag so that it can be tested before release.

@markdroth
Copy link
Member

For C-core, we have some tests that use a DNS server. You can talk to @apolcyn about how this was set up.

@carl-mastrangelo
Copy link
Contributor Author

@zhangkun83 ping

Copy link
Contributor

@zhangkun83 zhangkun83 left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. Overall LGTM, except for some minor comments.

Please prefix the PR title with "core/grpclb:" as we always do. The title is also a bit misleading, because we are not providing generic SRV results, but rather balancer addresses carried in SRV results. This should be made clear.

ResolutionResults(
List<InetAddress> addresses,
List<String> txtRecords,
List<EquivalentAddressGroup> srvRecords) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These are actually balancer addresses. They are not intended to be generic SRV records. Please name the variables (including those in CompositeResolver) accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Attributes.Builder attrs = Attributes.newBuilder();
if (!resolvedInetAddrs.txtRecords.isEmpty()) {
attrs.set(
GrpcAttributes.NAME_RESOLVER_ATTR_TXT,
Copy link
Contributor

Choose a reason for hiding this comment

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

TXT record is DNS-specific. Let's add "DNS" to the name of this attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@carl-mastrangelo carl-mastrangelo changed the title Resolve TXT and SRV records in DNS name resolver core/grpclb: resolve TXT and SRV records in DNS name resolver Dec 19, 2017
@carl-mastrangelo carl-mastrangelo changed the title core/grpclb: resolve TXT and SRV records in DNS name resolver core/grpclb: resolve TXT records in DNS name resolver and include balancer addresses Dec 19, 2017
@carl-mastrangelo carl-mastrangelo merged commit 6eaae5d into grpc:master Dec 19, 2017
@carl-mastrangelo carl-mastrangelo deleted the dnnis branch December 19, 2017 18:01
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
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.

4 participants