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

android DNS: add ability to use fallback nameservers #1953

Merged
merged 27 commits into from
Dec 16, 2021
Merged

Conversation

junr03
Copy link
Member

@junr03 junr03 commented Nov 30, 2021

Description: this PR uses config templating to introduce fallback DNS servers for c-ares in Android. Subsequent PR will add EngineBuilder configurability.
Risk Level: low -- the current config is a no-op.
Testing: e2e testing with the Lyft App

Jose Nino added 5 commits November 30, 2021 10:23
…1906)"

This reverts commit ab51d68.

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
…ength. (#1906)""

This reverts commit 8da335b.

Signed-off-by: Jose Nino <jnino@lyft.com>
@junr03 junr03 mentioned this pull request Nov 30, 2021
Jose Nino added 3 commits November 30, 2021 10:30
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Jose Nino added 3 commits December 2, 2021 15:27
Signed-off-by: Jose Nino <jnino@lyft.com>
iOS
Signed-off-by: Jose Nino <jnino@lyft.com>
…""

This reverts commit e279b30.

Signed-off-by: Jose Nino <jnino@lyft.com>
@@ -267,6 +268,9 @@ R"(
base_interval: *dns_fail_base_interval
max_interval: *dns_fail_max_interval
dns_query_timeout: *dns_query_timeout
typed_dns_resolver_config:
name: *dns_resolver_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Need a default for this. I think it makes sense to just specify c-ares as the default above (along with dns_resolver_config, and iOS can still always override it with the apple dns resolves.

Copy link
Member Author

Choose a reason for hiding this comment

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

@goaway I was wondering if this was the case. I make overrides for it on both the java and objc definitions so I saw no point in putting in a default in the common template given there is no common default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now the default (header + config) with no overrides is a valid config. I'd like to keep it that way.

One reason is that we can start to use it in tests, instead of the canned configs some tests use (that have tendency to drift).

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fair. Will update.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

@goaway
Copy link
Contributor

goaway commented Dec 3, 2021

Looks good overall, left one comment. Thanks for updating!

Jose Nino added 2 commits December 3, 2021 13:20
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
goaway
goaway previously approved these changes Dec 3, 2021
Copy link
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @junr03!

Jose Nino and others added 11 commits December 15, 2021 13:01
…cs (#1937)"""

This reverts commit 3cfa846.

Signed-off-by: Jose Nino <jnino@lyft.com>
This wrapper allows developers to quickly get off the ground without
having to install bazel or bazelisk manually.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Description: This is a followup to #1937.
Risk Level: I believe these extra parameters are safe to ignore if we don't need to propagate them to the Objective-C interface, but would like someone else to confirm that. (Confirmed.)
Testing: Example apps still work, and downstream (closed source) consumers now compile again.

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Description: Fix NSString to envoy_data conversion for non-ascii strings such as '台灣大哥大'. -length is the number of UTF-16 code units in the receiver whereas -lengthOfBytesUsingEncoding: is the number of UTF8 bytes. Using the latter is necessary since we're using this value to determine how many bytes to copy from the string.
Risk Level: Low.
Testing: Added an Objective-C unit test, and enabled running on CI.

Signed-off-by: JP Simard <jp@jpsim.com>
Description: Both v4_interfaces and v6_interfaces were using V4 interfaces likely due to a typo. This is a follow-up to #1897.
Risk Level: Low, just fixing a log.

Signed-off-by: JP Simard <jp@jpsim.com>
Changes: envoyproxy/envoy@23e5fc2...70a5f29

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
…am metrics (#1937)""""

This reverts commit 04b1864.

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Jose Nino and others added 2 commits December 15, 2021 13:03
fmt
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
@junr03 junr03 marked this pull request as ready for review December 15, 2021 22:21
@@ -100,6 +100,10 @@ std::string EngineBuilder::generateConfigStr() {
{"dns_preresolve_hostnames", this->dns_preresolve_hostnames_},
{"dns_refresh_rate", fmt::format("{}s", this->dns_refresh_seconds_)},
{"dns_query_timeout", fmt::format("{}s", this->dns_query_timeout_seconds_)},
{"dns_resolver_name", "envoy.network.dns_resolver.cares"},
{"dns_resolver_config",
"{\"@type\":\"type.googleapis.com/"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd suggest a string quoting approach that doesn't require a bunch of inline escaping

Copy link
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

Approved, just one minor nit.

@goaway
Copy link
Contributor

goaway commented Dec 15, 2021

Thanks @junr03!

@junr03 junr03 merged commit 373da93 into main Dec 16, 2021
@junr03 junr03 deleted the working-config branch December 16, 2021 00:06
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

Successfully merging this pull request may close these issues.

5 participants