-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-121621: clear running loop early in asyncio #128004
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
Conversation
For example, if you have a |
The issue is that the event loop has references to lot of objects with finalizers and running those later while interp is finalizing restricts what can be done. For example there are workarounds to only capture tracebacks when interp isn't finalizing in asyncio. cpython/Modules/_asynciomodule.c Lines 475 to 480 in 3b76682
|
It may be okay to also clear |
yeah, that sounds good to me |
Clearing the loop at late in finalization can run arbitrarily run finalizers at shutdown which is bad so we clear the ref to it when clearing the module to avoid running finalizers late.