classification
Title: Signal handling machinery still relies on "pending calls".
Type: behavior Stage: patch review
Components: Interpreter Core Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.snow Nosy List: emilyemorehouse, eric.snow, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2018-12-06 00:12 by eric.snow, last changed 2018-12-11 23:02 by eric.snow.

Pull Requests
URL Status Linked Edit
PR 10972 open eric.snow, 2018-12-06 00:18
Messages (3)
msg331196 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2018-12-06 00:12
For a while now the signal handling machinery has piggy-backed on ceval's "pending calls" machinery (e.g. Py_AddPendingCall).  This is a bit confusing.  It also increases the risk with unrelated changes to the pending calls code.
msg331197 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-06 00:16
In the master branch, the signal handler only uses pending calls to report error on writing into the "wakeup_fd" (fd or socket handle):

commit c08177a1ccad2ed0d50898c2731b518c631aed14
Author: Antoine Pitrou <pitrou@free.fr>
Date:   Wed Jun 28 23:29:29 2017 +0200

    bpo-30703: Improve signal delivery (#2415)
msg331654 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2018-12-11 21:55
Correct.  The remaining call to Py_AddPendingCall in the signal-handling code is fine.

This issue is only indirectly related.  I suppose you could consider it a follow-up to #30703.  The PR for that issue (GH-2415) switches from using pending calls for signal handlers to using the pending calls machinery without actual pending calls.

So here I want to address taking the next step: deal with pending signals separately from pending calls.  That separation helps simplify efforts to adapt the pending calls machinery for use in arbitrary threads (rather than the main thread).  See #33608.
History
Date User Action Args
2018-12-11 23:02:53eric.snowsetnosy: + emilyemorehouse
2018-12-11 21:55:32eric.snowsetnosy: + pitrou
messages: + msg331654
components: + Interpreter Core
2018-12-06 00:18:14eric.snowsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request10214
2018-12-06 00:16:05vstinnersetnosy: + vstinner
messages: + msg331197
2018-12-06 00:12:39eric.snowcreate