-
Notifications
You must be signed in to change notification settings - Fork 552
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
How does uvloop (or I think libuv) does dns resolution, is it fully async? #43
Comments
Yes, libuv uses a thread pool to do I'm still deciding how to approach this problem -- should we use c-ares? or getdns? Or keep things as is, since DNS in a thread pool is fine for most use cases? |
somewhat relevant to the conversation: https://gist.github.com/deltaindiatango/7bf157202c17681d62667a006eb15abd found some existing pure-Python resolver, did basic work to make async. It's not noticably slower than getaddrinfo/getnameinfo. |
Hi, Node guy here - Node.js does use c-ares. Here's discussion about replacing it nodejs/node#1013 DNS thread pool is a compromise. Node documents
And
|
@benjamingr Benjamin, thanks for chiming in! My current understanding is that for asyncio we'll have to approach this problem similarly to Node: add a completely new set of DNS APIs that doesn't use |
@1st1 I'm in the opinion you're doing an excellent job using libuv and that you shouldn't worry about this until it becomes a real problem. I'd argue that the vast majority of programs don't perform a huge amount of uncacheable DNS queries and that it's an edge case. I'd invest more in getting more library adoption and feedback. In practice the wrapper will behave like users expect for the vast majority of users. I don't see how you'd solve this without using something other than libuv either. |
|
But won't |
@WGH- |
we encountered a dns problem using socket.gaierror: [Errno -3] Temporary failure in name resolution this hangs our program maybe there's a way to set a timeout on the lookup or may uvloop dns lookup async? I found UV_THREADPOOL_SIZE may help, so I'm increasing it to maximum 128, still I think getting a way to timeout dns lookup or throw error will help the program, seems hanging is really bad... |
same issue here. +1 |
I've read the libuv documentation and it appears that it is, and that uvloop is calling directly into it. So if I use aiohttp to do requests will the dns resolution be async as well?
And do you know why node still uses c-ares to do dns resolution if libuv is fully async?
The text was updated successfully, but these errors were encountered: