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

Appearance settings

Fix TaskStatus.started() being a no-op when in an effectively cancelled scope#2896

Open
gschaffner wants to merge 6 commits into
python-trio:mainpython-trio/trio:mainfrom
gschaffner:fix-start-cancellationgschaffner/trio:fix-start-cancellationCopy head branch name to clipboard
Open

Fix TaskStatus.started() being a no-op when in an effectively cancelled scope#2896
gschaffner wants to merge 6 commits into
python-trio:mainpython-trio/trio:mainfrom
gschaffner:fix-start-cancellationgschaffner/trio:fix-start-cancellationCopy head branch name to clipboard

Conversation

@gschaffner

Copy link
Copy Markdown
Member

proposed patch and tests to fix #2895 and close #2544.

Specifically, make started() reparent the task even if the start() call
is in an effectively cancelled scope when started() is called, and check
sys.exc_info() to prevent calling task_status.started() while handling
active Cancelled(s).
@codecov

codecov Bot commented Dec 2, 2023

Copy link
Copy Markdown

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (a10f94b) 99.68% compared to head (651b51a) 99.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2896      +/-   ##
==========================================
- Coverage   99.68%   99.57%   -0.11%     
==========================================
  Files         117      117              
  Lines       17546    17579      +33     
  Branches     3152     3161       +9     
==========================================
+ Hits        17490    17505      +15     
- Misses         38       50      +12     
- Partials       18       24       +6     
Files Coverage Δ
src/trio/_core/_run.py 99.77% <ø> (-0.23%) ⬇️
src/trio/_core/_tests/test_run.py 99.88% <97.77%> (-0.12%) ⬇️

... and 2 files with indirect coverage changes

@njsmith

njsmith commented Dec 2, 2023 via email

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TaskStatus.started() being a no-op if cancelled can cause deadlocks Cancellation blocks task_status.started

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.