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 handler waiting on shutdown #8611

Merged
merged 3 commits into from
Aug 7, 2024
Merged

Fix handler waiting on shutdown #8611

merged 3 commits into from
Aug 7, 2024

Conversation

Dreamsorcerer
Copy link
Member

There seems to be some kind of race condition in certain circumstance which can lead to .wait_for_disconnection() being called after the request has already been cancelled.

Additionally, I see no guarantee that when .wait_for_disconnection() completes, that the handler itself has completed (and not suppressed a cancellation etc.).

However, I couldn't figure out a shutdown test in test_run_app.py that triggers this edge case.

@Dreamsorcerer Dreamsorcerer added backport-3.10 backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot labels Aug 5, 2024
@Dreamsorcerer Dreamsorcerer requested a review from asvetlov as a code owner August 5, 2024 16:31
@Dreamsorcerer Dreamsorcerer requested a review from webknjaz as a code owner August 5, 2024 16:33
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 5, 2024
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.68%. Comparing base (b7121e5) to head (99b0c5a).
Report is 861 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8611      +/-   ##
==========================================
- Coverage   97.70%   97.68%   -0.03%     
==========================================
  Files         107      107              
  Lines       33438    33441       +3     
  Branches     3927     3928       +1     
==========================================
- Hits        32672    32666       -6     
- Misses        555      563       +8     
- Partials      211      212       +1     
Flag Coverage Δ
CI-GHA 97.59% <100.00%> (-0.03%) ⬇️
OS-Linux 97.24% <100.00%> (-0.03%) ⬇️
OS-Windows 95.61% <100.00%> (-0.03%) ⬇️
OS-macOS 96.91% <100.00%> (-0.03%) ⬇️
Py-3.10.11 97.06% <100.00%> (-0.03%) ⬇️
Py-3.10.14 96.99% <100.00%> (-0.03%) ⬇️
Py-3.11.9 97.22% <100.00%> (-0.03%) ⬇️
Py-3.12.4 97.35% <100.00%> (-0.03%) ⬇️
Py-3.8.10 95.37% <100.00%> (-0.03%) ⬇️
Py-3.8.18 96.89% <100.00%> (-0.03%) ⬇️
Py-3.9.13 97.04% <100.00%> (-0.03%) ⬇️
Py-3.9.19 96.99% <100.00%> (-0.03%) ⬇️
Py-pypy7.3.16 96.56% <100.00%> (-0.03%) ⬇️
VM-macos 96.91% <100.00%> (-0.03%) ⬇️
VM-ubuntu 97.24% <100.00%> (-0.03%) ⬇️
VM-windows 95.61% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dreamsorcerer
Copy link
Member Author

So, I'm now not convinced that wait_for_disconnection() is useful (and possibly not correct). Maybe it should be removed again...?

@bdraco
Copy link
Member

bdraco commented Aug 7, 2024

So, I'm now not convinced that wait_for_disconnection() is useful (and possibly not correct). Maybe it should be removed again...?

I'm not sure its useful, but I've also never had a use case for it. I'd open an issue to provide notice of intent to remove it, and than do so in 30 days if nobody objects.

@bdraco bdraco merged commit 1fcef94 into master Aug 7, 2024
37 of 38 checks passed
@bdraco bdraco deleted the Dreamsorcerer-patch-4 branch August 7, 2024 12:49
Copy link
Contributor

patchback bot commented Aug 7, 2024

Backport to 3.10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.10/1fcef940e37c93f1dc05b859816affaf7228b2f8/pr-8611

Backported as #8627

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 7, 2024
Copy link
Contributor

patchback bot commented Aug 7, 2024

Backport to 3.11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.11/1fcef940e37c93f1dc05b859816affaf7228b2f8/pr-8611

Backported as #8628

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 7, 2024
@Dreamsorcerer
Copy link
Member Author

I'm not sure its useful, but I've also never had a use case for it. I'd open an issue to provide notice of intent to remove it, and than do so in 30 days if nobody objects.

Well, it's only been in a release for a week or so. So, it's incredibly unlikely people are already using it, we can probably just strip in the next 3.10 release before most users have finished upgrading to 3.10.

@bdraco
Copy link
Member

bdraco commented Aug 7, 2024

I'm not sure its useful, but I've also never had a use case for it. I'd open an issue to provide notice of intent to remove it, and than do so in 30 days if nobody objects.

Well, it's only been in a release for a week or so. So, it's incredibly unlikely people are already using it, we can probably just strip in the next 3.10 release before most users have finished upgrading to 3.10.

I agree. No need to wait as its unlikely its being used.

bdraco pushed a commit that referenced this pull request Aug 7, 2024
bdraco pushed a commit that referenced this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants