-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Closed as not planned
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import asyncio
from threading import Thread
import time
loop = asyncio.new_event_loop()
def example():
print('starting loop...')
loop.run_forever()
async def test():
Thread(None, example).start()
asyncio.run(test())
time.sleep(1)
loop.stop()
print('hang...')
This hangs forever. I would expect it to stop. If I add any task to the loop first, then it stops. I have an async threadpool for no-GIL, and to stop it I need to add dummy task to each loop on stop. It seems like a bug, is it a bug?
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error