-
Notifications
You must be signed in to change notification settings - Fork 69
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
Queries intermittently freezing asyncio event loop #122
Comments
The nature of this issue means that using asyncio timeout wrappers cannot work, because once the thread's event loop is stuck inside a C function call, there's no way for a |
I've also filed an issue with the |
What a weird one! Drilling down, what happens is pycares got some activity on a file descriptor and called the socket state callback, which aiodns uses: Line 137 in 1c5f28f
Here is where pycares calls is: https://github.com/saghul/pycares/blob/de2ed40596f543f989bbcea30632be751133c110/src/pycares/__init__.py#L97 Something seems to happen which causes an unraiseable error: Very weird. On the pycares issue you seem to be using 4.2 which is an older release. Can you please test with the latest version of both packages? Also, a repro script, even if it takes ours would be useful. |
Most of the time, aiodns is fine. But on rare occasions, it gets stuck on a C
write()
call deep within pycares.This freezes the entire event loop indefinitely, because the
write()
call never returns.My original calling code is like:
For now, I'll look at workarounds like moving all my
aiodns
queries off to separate threads, but this seems to be inefficient.But I'd welcome some advice on this.
Below is the py-spy stack trace of where the aiodns call is getting stuck.
The text was updated successfully, but these errors were encountered: