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

Don't use a thread pool for DNS resolution #1235

Closed
tomaka opened this issue Sep 1, 2019 · 4 comments · Fixed by #1927
Closed

Don't use a thread pool for DNS resolution #1235

tomaka opened this issue Sep 1, 2019 · 4 comments · Fixed by #1927

Comments

@tomaka
Copy link
Member

tomaka commented Sep 1, 2019

Right now, we use a thread pool dedicated to resolving domain names by calling to_socket_addrs. Theoretically, there's no reason for it not to be asynchronous.

In practice, as far as I know, there's no way to do at at the moment. However I'm opening this issue anyway in order to not forget about that in the long term.

@mxinden
Copy link
Member

mxinden commented Sep 3, 2019

Do I understand correctly that tokio-dns-unofficial uses the host OS's resolver via a thread pool?

In that case I find the name of the issue a bit misleading. How about "Don't use synchronous host OS's dns resolver via thread pool"?

Async in process dns resolution

In case an in-process DNS async resolver adhering to /etc/resolv.conf is an option, how about trust dns resolver?

Async OS dns resolution

Or in case we mostly target Linux and fall back to synchronous DNS resolution, something like getaddrinfo_a could be an option.

What do you think @tomaka?

@tomaka
Copy link
Member Author

tomaka commented Sep 3, 2019

I think that we shouldn't waste any energy on that issue, at least not before async/await.

@tomaka
Copy link
Member Author

tomaka commented Sep 5, 2019

For what it's worth, async-std decided to use background tasks: async-rs/async-std#74

@DemiMarie
Copy link
Contributor

I think we could use either trust-dns or libasr. The latter is a C library, but it comes from OpenBSD and is used in OpenSMTPD among other projects, so I am quite confident in its security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants