Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gschaffner
Copy link
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).
Copy link

codecov bot commented Dec 2, 2023

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
Copy link
Member

njsmith commented Dec 2, 2023 via email

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