Tasks not awaited after calling cancel in shutdown #2422
Unanswered
PokkaKiyo
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Happened to come across the following snippet of code in the shutdown logic while trying to understand the graceful shutdown logic in server.py:
After calling cancel on an asyncio Task, the Task should be awaited, which is not happening here (and across a handful of places in the code base), since Task.cancel() alone does not cancel the task.
https://docs.python.org/3/library/asyncio-task.html#asyncio.Task.cancel
Is this worth changing/fixing? I suppose adding a simple loop across the tasks to await them and catch the CancelledError should be sufficient?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions