-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-39622: Use a custom signal handler in asyncio.run() #18628
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
bpo-39622: Use a custom signal handler in asyncio.run() #18628
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this with @1st1 and declined because the approach cannot interrupt the infinite loop without yield-point, e.g.
while True:
pass
07e04c6 to
cbcc88f
Compare
|
Thank you for your review. I've responded on the thread in https://bugs.python.org/issue39622 |
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
cbcc88f to
68e1a6f
Compare
68e1a6f to
eb98f73
Compare
Codecov Report
@@ Coverage Diff @@
## master #18628 +/- ##
===========================================
+ Coverage 82.12% 83.22% +1.09%
===========================================
Files 1956 1571 -385
Lines 589917 415337 -174580
Branches 44479 44489 +10
===========================================
- Hits 484497 345666 -138831
+ Misses 95770 60023 -35747
+ Partials 9650 9648 -2
Continue to review full report at Codecov.
|
8baf245 to
2bf50eb
Compare
2bf50eb to
616bf89
Compare
|
Actually I kind of like this approach. @asvetlov? |
Hi @kmaork, as said in #18628 (comment) you can reply with "I have made the requested changes; please review again" and the tag will be updated. |
|
Damn, completely missed that. Thanks! I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @1st1: please review the changes made to this pull request. |
|
Hey there! I have encountered exactly this issue. any chance that it'll be merged any time soon? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kmaork could you please synchronize the PR with the main branch before I'll start the actual review process?
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Closed for the sake of #32105 |
|
Thanks for the inspiration! |
In short - the default python SIGINT handler can cause the event loop to lose handles and get stuck. Therefore when running a loop we should use a SIGINT handler more fitting to the situation.
See detailed explanation (and bug demo scripts) here - https://bugs.python.org/issue39622
https://bugs.python.org/issue39622