bpo-30703: Improve signal delivery#2415
Conversation
Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions.
|
@pitrou, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @serhiy-storchaka and @1st1 to be potential reviewers. |
Sorry, something went wrong.
|
The test I'm adding here fails without the rest of the patch (on Linux and OS X). This means our signal delivery logic really had holes in it. |
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
Since I wrote the first version of this change, I like the design, haha. More seriously, the overall change LGTM.
But I added a few comments with some questions.
Sorry, something went wrong.
|
About the test, I would even prefer to not have such test. Or maybe only run it a few times (ex: 100 signals, not 10 000). |
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I'm not confortable to backport this change on stable versions right now. If you want to backport it, maybe wait at least one week to see if the test works well on all buildbots.
Sorry, something went wrong.
|
Agreed. If it goes well then I may consider a backport to 3.6. I think 2.7 and 3.5 are out of question. |
Sorry, something went wrong.
|
It seems some systems may have crappy resolution for
This might explain the failure here: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/275/steps/test/logs/stdio |
Sorry, something went wrong.
|
Same for AIX:
(https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.basetrf1/getinterval.htm) |
Sorry, something went wrong.
|
I told you. Your test looks like a nightmare to me :-) In the worst case,
just make it specific to Linux?
|
Sorry, something went wrong.
|
Please stop being offensive with my test :-) |
Sorry, something went wrong.
|
Ok, as soon as you stop to harass my little buildbots!
|
Sorry, something went wrong.
* [3.6] bpo-30703: Improve signal delivery (GH-2415) * Improve signal delivery Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions. * Remove unused function * Improve comments * Add stress test * Adapt for --without-threads * Add second stress test * Add NEWS blurb * Address comments @Haypo. (cherry picked from commit c08177a) * bpo-30796: Fix failures in signal delivery stress test (#2488) * bpo-30796: Fix failures in signal delivery stress test setitimer() can have a poor minimum resolution on some machines, this would make the test reach its deadline (and a stray signal could then kill a subsequent test). * Make sure to clear the itimer after the test
Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions.