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

Signal handling machinery still relies on "pending calls". #79604

Closed
ericsnowcurrently opened this issue Dec 6, 2018 · 4 comments
Closed

Signal handling machinery still relies on "pending calls". #79604

ericsnowcurrently opened this issue Dec 6, 2018 · 4 comments
Assignees
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@ericsnowcurrently
Copy link
Member

BPO 35423
Nosy @pitrou, @vstinner, @ericsnowcurrently, @emilyemorehouse
PRs
  • bpo-35423: Stop using the "pending calls" machinery for signals. #10972
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ericsnowcurrently'
    closed_at = <Date 2019-01-11.21:50:36.931>
    created_at = <Date 2018-12-06.00:12:39.591>
    labels = ['interpreter-core', 'type-bug', '3.8']
    title = 'Signal handling machinery still relies on "pending calls".'
    updated_at = <Date 2019-01-11.21:50:36.931>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2019-01-11.21:50:36.931>
    actor = 'eric.snow'
    assignee = 'eric.snow'
    closed = True
    closed_date = <Date 2019-01-11.21:50:36.931>
    closer = 'eric.snow'
    components = ['Interpreter Core']
    creation = <Date 2018-12-06.00:12:39.591>
    creator = 'eric.snow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35423
    keywords = ['patch']
    message_count = 4.0
    messages = ['331196', '331197', '331654', '333507']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'vstinner', 'eric.snow', 'emilyemorehouse']
    pr_nums = ['10972']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35423'
    versions = ['Python 3.8']

    @ericsnowcurrently
    Copy link
    Member Author

    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.

    @ericsnowcurrently ericsnowcurrently added the 3.8 only security fixes label Dec 6, 2018
    @ericsnowcurrently ericsnowcurrently self-assigned this Dec 6, 2018
    @ericsnowcurrently ericsnowcurrently added the type-bug An unexpected behavior, bug, or error label Dec 6, 2018
    @vstinner
    Copy link
    Member

    vstinner commented Dec 6, 2018

    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 c08177a
    Author: Antoine Pitrou <pitrou@free.fr>
    Date: Wed Jun 28 23:29:29 2017 +0200

    bpo-30703: Improve signal delivery (bpo-2415)
    

    @ericsnowcurrently
    Copy link
    Member Author

    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 bpo-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 bpo-33608.

    @ericsnowcurrently ericsnowcurrently added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Dec 11, 2018
    @ericsnowcurrently
    Copy link
    Member Author

    New changeset fdf282d by Eric Snow in branch 'master':
    bpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)
    fdf282d

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants