-
Notifications
You must be signed in to change notification settings - Fork 1
How to clean up after ctrl-c? #129
Copy link
Copy link
Open
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Users want to be able to interrupt any plan using the ctrl-c keyboard interrupt. After choosing one of the options that ends the run, the interrupt should call some code that will clean up and return the instrument to a known state.
The RunEngine provides support for ctrl-c interrupts from the user. Our challenge is when a lower-level plan is written that absorbs the ^C keyboard interrupts, such as:
try:
yield from some_plan_a_user_might_interrupt_with_control_c()
except Exception: # includes the ^C from the keyboard ...
pass # ... and ignores the problemWe need general guidance to write effective try..except clauses in plans that preserve the RunEngine's handling of ctrl-c keyboard interrupts. And guidance about the clean-up plans.
Must consider cases when interrupting from
- a lower-level plan that implements some
try..excepthandling - a sequence of plans during a single call to
RE - a sequence of plans during a sequence of calls to
RE
attn: @qzhang234, @sureshnaps, @jilavsky (who has a similar request)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists