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

Remove UDP connection caching in embedded DNS server #1352

Merged
merged 1 commit into from
Jul 25, 2016

Conversation

sanimej
Copy link

@sanimej sanimej commented Jul 24, 2016

In 1.11 we made a change to source the external queries from the container namespace. This allows the external resolvers to see the source IP of the container that generated the query. That was useful for resolvers that want to use the source of the query in some way to determine what the response should be.

Along with this there was also a change to cache the external UDP connections after its opened the first time. This avoids having to set into the container namespace and will avoid the chances of new OS thread getting created in the container net ns. For the first query we still have to set into container net ns. Also the caching can't be done for TCP because a long running TCP session to a DNS server is not the usual practice can get RST by the server.

UDP connection caching has added lot of complexity to the code and hard to debug issues like docker #22185.

This PR removes the UDP connection caching. The only operation that happens in the container net ns is a UDP Dial which is a local non-blocking operation without any network io. This is not likely to lead to a go routine (and OS thread) creation. Verified this by running a test similar to libnetwork #1113; right after the daemon comes up start 20 containers running a go code triggering a total of 4000 name resolutions.

Signed-off-by: Santhosh Manohar santhosh@docker.com

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
@mavenugo
Copy link
Contributor

LGTM.

I believe this will solve a bunch of issues. is it possible to list the issues ?

@aboch
Copy link
Contributor

aboch commented Jul 25, 2016

LGTM

@aboch aboch merged commit 6a3feec into moby:master Jul 25, 2016
alexjh pushed a commit to SUSE/scf that referenced this pull request Aug 2, 2016
Move to released docker version to get moby/libnetwork#1352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants