DiamondLightSource / DiamondLightSource/dodal
Eiger unstage is called twice if unstage raises exception during a plan
- Dominant language
- Python
- Stars
- 5
- Forks
- 13
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 10
Description
During the Eiger's `unstage`, it performs some actions which can raise exceptions, for example `stop_odin_when_all_frames_collected`. If an exception is raised using the `Bluesky` `RunEngine`, the `RunEngine` will automatically call `unstage` for any devices which were previously staged in the plan (see https://github.com/bluesky/bluesky/blob/add624e1b7f03c9b4b981e78dfc2333ed01e1f0c/src/bluesky/run_engine.py#L1449). This results in unstage being called for a second time, and we have to wait for `stop_odin_when_all_frames_collected` to timeout again before the program properly exits.
## Acceptance Criteria
* Actions within the `Eiger`'s `unstage` which may raise `Exception`s are taken out of unstage, and performed before we try to `unstage`
* Tests which fail before the change and pass after the change
Contributor guide
Assessment
This issue has not been assessed yet.