-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Configurable DNS resolvers #4236
Conversation
Hey @ysbaddaden, what's the current status on this? |
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. |
@ysbaddaden failing specs seems to be IPv4 to IPv6 representation difference ? |
@ysbaddaden What is the current status on this? |
apparently libuv uses a thread pool for it as well: https://stackoverflow.com/questions/44603059/why-libuv-do-dns-request-by-multiple-thread FWIW... |
I'd still loove to see an "all native" option for resolving DNS... :) |
I think we can close this PR. It's out of sync and would need a fresh start anyway. |
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:
getaddrinfo
), which resolves everything but blocks the event loop;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).