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

close_loop coroutine instantiated but never awaited in (old?) asyncio loop integration #1260

Open
johnfb opened this issue Aug 2, 2024 · 1 comment

Comments

@johnfb
Copy link

johnfb commented Aug 2, 2024

I was trawling through the source code and I spotted what looks to me like a possible bug here:

close_loop()

This instantiates a coroutine that never gets awaited. Calling an async def function just returns a coroutine object and does not start evaluating the function until the coroutine is started.

Additional poking around makes it look like asyncio loop integration here is actually semi-dead code from an era when the tornado event loop and asynio event loop where not the same event loop (tornado < 5?). Seems like this should be cleaned up, as my read is this old asyncio loop integration is not being maintained. Maybe a deprecation warning should be displayed if anyone tries to use %gui asyncio or something?

@ianthomas23
Copy link
Collaborator

@johnfb Thanks for the report. Quite a lot of the event loop code hasn't been updated to correctly use anyio, e.g. #1235. This will need to be done before the 7.0 release.

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

No branches or pull requests

2 participants