Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Allow users to specify DNS servers to use#31

Merged
rculbertson merged 1 commit intomasterfrom
ryan/specify-dns-servers
Mar 29, 2018
Merged

Allow users to specify DNS servers to use#31
rculbertson merged 1 commit intomasterfrom
ryan/specify-dns-servers

Conversation

@rculbertson
Copy link
Contributor

This PR modifies DnsSrvResolver to that each instance can be configured to use
specific DNS servers. This PR also makes it so that timeouts are configured per
instance, instead of globally.

@rculbertson
Copy link
Contributor Author

@pettermahlen

@rculbertson rculbertson force-pushed the ryan/specify-dns-servers branch from 52d55b2 to cf2a585 Compare January 23, 2018 20:58
Copy link
Member

@pettermahlen pettermahlen left a comment

Choose a reason for hiding this comment

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

The change looks good overall - the test case doesn't seem to actually be testing what it claims to do, though? It mostly just validates that the builder method exists. Something that would be great is to document the format of the servers list. I notice there's not a lot of javadoc to date, but a javadoc comment on the new builder method describing what it does and how to use it would be great.

.newBuilder()
.servers(ImmutableList.of(server))
.build();
assertThat(resolver.resolve("_spotify-client._tcp.spotify.com").isEmpty(), is(false));
Copy link
Member

Choose a reason for hiding this comment

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

This test doesn't actually test that the given resolver is used, does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're correct that it doesn't verify that specified server was actually used. But it's invoking the resolve method and testing that code path, making sure it returns successfully. I'm not sure how to test that the resolver actually used the specified server.

This PR modifies DnsSrvResolver so that each instance can be configured to use
specific DNS servers. This PR also makes it so that timeouts are configured per
instance, instead of globally.
@rculbertson rculbertson force-pushed the ryan/specify-dns-servers branch from cf2a585 to a92ba0b Compare March 27, 2018 21:40
@rculbertson
Copy link
Contributor Author

Good suggestion about javadoc. I added some to the builder method.

@rculbertson
Copy link
Contributor Author

Thanks @pettermahlen!

@rculbertson rculbertson merged commit c554287 into master Mar 29, 2018
@rculbertson rculbertson deleted the ryan/specify-dns-servers branch March 29, 2018 01:53
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