Skip to content

How should shielding interact with restrict_keyboard_interrupt_to_checkpoints? #151

@njsmith

Description

@njsmith

Right now KeyboardInterrupt can (if using the default handler) arrive anywhere; restrict_keyboard_interrupt_to_checkpoints=True makes it so it can only arrive at checkpoints. But in principle it can arrive at any checkpoint. In practice it currently only arrives at checkpoints inside the main task, which usually is going to be sitting in supervisor code. And currently it ignores shield=True scopes – you can get KeyboardInterrupted even if you're shielded against Cancelled.

The nursery clean-up code is prepared to handle this correctly, and that's what the main task will be doing in most cases, so this isn't super urgent. But it is surprising, maybe? Is it correct?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions