Skip to content

Conversation

@dgoffredo
Copy link
Contributor

@dgoffredo dgoffredo commented Oct 18, 2023

nginx uses gethostbyname() to look up IP addresses for upstreams (unless you designate a resolver). Both libc flavors (glibc and musl) as configured in our test images, will first check /etc/hosts before going to DNS. DNS sometimes takes five seconds (instead of the more typical < 1 ms), which causes a timeout in the tracing library, which causes tests to fail that are checking whether the tracer sent a trace to the Agent.

This revision pre-populates the nginx container's /etc/hosts with the other docker compose services' IP addresses.

@dgoffredo dgoffredo requested a review from dmehala October 18, 2023 13:00
Copy link
Contributor

@dmehala dmehala left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

default `gethostbyname()` resolver used by nginx will not use DNS."""
script = f"""
for service in {" ".join(f"'{service}'" for service in services)}; do
getent hosts "$service" >>/etc/hosts
Copy link
Contributor

Choose a reason for hiding this comment

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

First time I encounter getent, interesting. I thought you would use docker inspect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

docker inspect might be a better way. I'll have a look.

@dmehala dmehala force-pushed the dmehala/arm64-support branch 3 times, most recently from 7745d0a to ef007f3 Compare October 19, 2023 11:51
@dgoffredo
Copy link
Contributor Author

Thanks. I'll resolve the conflicts and merge after the ARM64 branch is merged into master.

@dmehala
Copy link
Contributor

dmehala commented Oct 20, 2023

It has been cherry-picked in #45 . Thanks a lot @dgoffredo.

@dmehala dmehala closed this Oct 20, 2023
@dgoffredo dgoffredo deleted the david.goffredo/dmehala/arm64-support branch October 23, 2023 13:24
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.

3 participants