You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Yes
Does uvloop behave differently from vanilla asyncio? How?: Yes, described below.
With stock asyncio, after awaiting on Server.serve_forever(), calling Server.close() causes the await statement to throw CancelledError. With uvloop's implementation, the listening socket is correctly closed, however the await statement blocks indefinitely.
PYTHONASYNCIODEBUG
in env?: YesWith stock asyncio, after awaiting on
Server.serve_forever()
, callingServer.close()
causes theawait
statement to throwCancelledError
. With uvloop's implementation, the listening socket is correctly closed, however theawait
statement blocks indefinitely.Example:
The uvloop version closes the listening socket in response to SIGTERM, but never exits. The stock version prints
Shutting down
and exits.Here's the CPython source where this is implemented:
https://github.com/python/cpython/blob/v3.8.18/Lib/asyncio/base_events.py#L341-L344
Thanks for taking a look!
The text was updated successfully, but these errors were encountered: