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

dns: add a getaddrinfo based system resolver #22080

Merged
merged 18 commits into from
Jul 14, 2022
Merged

Conversation

mattklein123
Copy link
Member

@mattklein123 mattklein123 commented Jul 8, 2022

This can be used when using the system resolver is desired. For
example, on Android.

Risk Level: None, new extension
Testing: New tests
Docs Changes: Added
Release Notes: Added
Platform Specific Features: TBD

@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #22080 was opened by mattklein123.

see: more, trace.

@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #22080 was opened by mattklein123.

see: more, trace.

@mattklein123
Copy link
Member Author

Not quite finished but I want to see what problems CI gives me.

Comment on lines 153 to 161
addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
// If we don't specify a socket type, every address will appear twice, once
// for SOCK_STREAM and one for SOCK_DGRAM. Since we do not return the family
// anyway, just pick one.
hints.ai_socktype = SOCK_STREAM;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is copied from the Android OS implementation.

@mattklein123 mattklein123 force-pushed the getaddrinfo-resolver branch 3 times, most recently from 1450040 to e093217 Compare July 8, 2022 22:31
This can be used when using the system resolver is desired. For
example, on Android.

Signed-off-by: Matt Klein <mklein@lyft.com>
@mattklein123 mattklein123 force-pushed the getaddrinfo-resolver branch from e093217 to 69eb66d Compare July 8, 2022 22:44
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
@mattklein123 mattklein123 marked this pull request as ready for review July 11, 2022 22:22
@mattklein123
Copy link
Member Author

OK I think this is ready.

Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

Looks like coverage isn't happy but here's some first ass comments while you sort that :-)
/wait

@mattklein123
Copy link
Member Author

Unfortunately the coverage tool is missing braces so there isn't much I can do about this. I will drop the limit:
https://storage.googleapis.com/envoy-pr/17b2cb1/coverage/source/extensions/network/dns_resolver/getaddrinfo/getaddrinfo.cc.gcov.html

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

/lgtm api

Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Other than a few nits, this looks great (not surprisingly).

source/common/api/posix/os_sys_calls_impl.cc Outdated Show resolved Hide resolved
source/common/api/win32/os_sys_calls_impl.cc Outdated Show resolved Hide resolved
Signed-off-by: Matt Klein <mklein@lyft.com>
@mattklein123
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit didn't fail.

🐱

Caused by: a #22080 (comment) was created by @mattklein123.

see: more, trace.

@mattklein123
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #22080 (comment) was created by @mattklein123.

see: more, trace.

soulxu
soulxu previously approved these changes Jul 13, 2022
Copy link
Member

@soulxu soulxu 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

Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

Just the one testing nit and you're good to go. Thanks!

Signed-off-by: Matt Klein <mklein@lyft.com>
@mattklein123 mattklein123 merged commit 516b3f3 into main Jul 14, 2022
@mattklein123 mattklein123 deleted the getaddrinfo-resolver branch July 14, 2022 04:07
jpsim added a commit to envoyproxy/envoy-mobile that referenced this pull request Jul 14, 2022
For non-Apple platforms like Linux and Android.

Updated the Kotlin, Java & C++ builders.

Added here: envoyproxy/envoy#22080

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit to envoyproxy/envoy-mobile that referenced this pull request Jul 14, 2022
For non-Apple platforms like Linux and Android.

Updated the Kotlin, Java & C++ builders.

Added here: envoyproxy/envoy#22080

Risk Level: Low to moderate, off by default but I had to refactor some stuff.
Testing: Added.
Docs Changes: Documentation comments.
Release Notes: Added.

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit that referenced this pull request Nov 29, 2022
For non-Apple platforms like Linux and Android.

Updated the Kotlin, Java & C++ builders.

Added here: #22080

Risk Level: Low to moderate, off by default but I had to refactor some stuff.
Testing: Added.
Docs Changes: Documentation comments.
Release Notes: Added.

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants