Skip to content

How should shielding interact with restrict_keyboard_interrupt_to_checkpoints? #151

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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