diff options
author | Guido van Rossum <guido@python.org> | 2022-06-30 17:10:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 17:10:46 (GMT) |
commit | 594c3699492bfb007650538726d953cbed55de04 (patch) | |
tree | 0c08bef359427752e98c566d436e5d3208b1b490 /Doc/library | |
parent | 4261b6bffc0b8bb5c6d4d80578a81b7520f4aefc (diff) | |
download | cpython-594c3699492bfb007650538726d953cbed55de04.zip cpython-594c3699492bfb007650538726d953cbed55de04.tar.gz cpython-594c3699492bfb007650538726d953cbed55de04.tar.bz2 |
GH-94398: TaskGroup: Fail create_task() during shutdown (GH-94400)
Once the task group is shutting down, it should not be possible to create a new task.
Here "shutting down" means `self._aborting` is set, indicating that at least one task
has failed and we have cancelled all others.
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-task.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 9b76548..7696976 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -320,6 +320,7 @@ no new tasks may be added to the group. The first time any of the tasks belonging to the group fails with an exception other than :exc:`asyncio.CancelledError`, the remaining tasks in the group are cancelled. +No further tasks can then be added to the group. At this point, if the body of the ``async with`` statement is still active (i.e., :meth:`~object.__aexit__` hasn't been called yet), the task directly containing the ``async with`` statement is also cancelled. |