Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-116720: Fix corner cases of taskgroups#117407

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gvanrossum merged 21 commits intopython:mainfromgvanrossum:fix-tg
Apr 9, 2024
Merged
Changes from1 commit
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
90695c5
Fix taskgroups handling of parent cancellation
gvanrossumMar 31, 2024
6c4876d
When errors and parent cancellation are both pending, re-cancel parent
gvanrossumMar 31, 2024
df6e8b7
When uncancel() reaches zero, clear _must_cancel
gvanrossumMar 31, 2024
c762e36
Remove 'experimental' comment
gvanrossumApr 1, 2024
4989042
Remove unneeded Py_CLEAR(self->task_cancel_msg)
gvanrossumApr 4, 2024
3f91f2d
Simple test for preserving cancelling() level
gvanrossumApr 4, 2024
55ff73f
Add test for nested task groups
gvanrossumApr 4, 2024
50fd8d6
Add test that is fixed by the re-cancel in __aexit__
gvanrossumApr 4, 2024
93ba76a
Test that uncancel() sets _must_cancel to False
gvanrossumApr 4, 2024
f1f89c0
Move a stray asyncio news item into the asyncio section
gvanrossumApr 4, 2024
48c6dda
Add blurb
gvanrossumApr 4, 2024
1e20728
Add what's new entry
gvanrossumApr 4, 2024
bc1522c
Update uncancel docs
gvanrossumApr 5, 2024
7f6e5ff
Update task group docs
gvanrossumApr 5, 2024
56251ff
Merge remote-tracking branch 'origin/main' into fix-tg
gvanrossumApr 5, 2024
c54fb22
Fix markup error
gvanrossumApr 5, 2024
6d4b3d7
Add attribution to Arthur Tacca issue
gvanrossumApr 5, 2024
b086609
Wording changes suggested by Carol Willing
gvanrossumApr 8, 2024
8ac42f6
Changelog/whatsnew updates from Arthur Tacca
gvanrossumApr 8, 2024
ac87a8e
Attempted doc improvements inspired by Arthur Tacca's feedback
gvanrossumApr 9, 2024
be9365c
Merge remote-tracking branch 'origin/main' into fix-tg
gvanrossumApr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update task group docs
  • Loading branch information
@gvanrossum
gvanrossum committedApr 5, 2024
commit7f6e5ffe8fe046aa22e3c668d96c35340d850166
22 changes: 22 additions & 0 deletionsDoc/library/asyncio-task.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -392,6 +392,28 @@ is also included in the exception group.
The same special case is made for
:exc:`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph.

Task groups are careful not to drop outside cancellations
when they collide with a cancellation internal to the task group.
In particular, when one task group is syntactically nested in another,
and both experience an exception in one of their child tasks simultaneously,
the inner task group will process its exceptions, and then the outer task group
will experience another cancellation and process its own exceptions.

In the case where a task group is cancelled from the outside and also must
raise an :exc:`ExceptionGroup`, it will call the parent task's
:meth:`~asyncio.Task.cancel` method. This allows a :keyword:`try` /
:keyword:`except* <except_star>` surrounding the task group to handle
the exceptions in the ``ExceptionGroup`` without losing the cancellation.
The :exc:`asyncio.CancelledError` will be raised at the next
:keyword:`await` (which may be implied at the end of a surrounding
:keyword:`async with` block).

Task groups now preserve the cancellation count
(as reported by :meth:`asyncio.Task.cancelling`).

.. versionchaged:: 3.13

Improved handling of simultaneous inside and outside cancellation.

Sleeping
========
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp