Skip to content

How to clean up after ctrl-c? #129

@prjemian

Description

@prjemian

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 problem

We 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..except handling
  • 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)

Metadata

Metadata

Assignees

Labels

duplicateThis issue or pull request already exists

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions