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

Configurable DNS resolvers #4236

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Apr 4, 2017

This pull request is a rework of #2829 with an alternative solution: introduce a configurable resolver. The initial issue is that we may have either:

  • a system call (getaddrinfo), which resolves everything but blocks the event loop;
  • an evented resolver (libevent), which is fully evented, but limited compared to the syscall (e.g. Docker, NSS, ...).

An usual solution to this problem is to have worker threads that will resolve domains asynchronously using the system call, whilst not blocking the event loop. This is okayish, but requires to have dedicated threads and communication.

This pull request doesn't choose one solution, but instead allows the developer to chose which one is the best for its application: a blocking resolver (default), an evented resolver or a threaded resolver, or any other solution.


There is one last thing I'd like to change: drop the per-request DNS timeout. It should be configured globally, either on the system, or when creating the resolver, if it's configurable. Actually, only the evented resolver has a DNS timeout configuration (global).

@sdogruyol
Copy link
Member

Hey @ysbaddaden, what's the current status on this?

@ysbaddaden ysbaddaden mentioned this pull request Mar 29, 2018
8 tasks
@ysbaddaden
Copy link
Contributor Author

Nowhere. It should be reviewed, the failing specs be fixed, and the threaded resolver be extracted into a shard, since it doesn't fit the stdlib, leaving only the blocking and evented resolvers.

@bararchy
Copy link
Contributor

@ysbaddaden failing specs seems to be IPv4 to IPv6 representation difference ?

@jkthorne
Copy link
Contributor

@ysbaddaden What is the current status on this?

@rdp
Copy link
Contributor

rdp commented Nov 20, 2019

apparently libuv uses a thread pool for it as well: https://stackoverflow.com/questions/44603059/why-libuv-do-dns-request-by-multiple-thread FWIW...

@rdp
Copy link
Contributor

rdp commented Nov 29, 2019

I'd still loove to see an "all native" option for resolving DNS... :)

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.

None yet

6 participants