Skip to content

How do we handle stop all #1681

Open
Open

Description

@DominicOram

There is a usecase for a stop button that, regardless of whether a plan is running, will run some (beamline specific) stop code.

Setting BlueAPI to aborting can handle some of this but not all as it will do nothing if BlueAPI is already running.

There are a few options to handle this:

Acceptance Criteria

  • A decision is made on how we handle stop all

Activity

  1. Mark-Booth commented on Sep 22, 2026

    @Mark-Booth
    Member

    Remember that Blueapi is not a safety system.

    Only a big red physical button is truly an Emergency Stop, so we should never refer to any software button as an "Emergency Stop" or "E-Stop" because it isn't. This is why in GDA we have a "Stop All" button, to make that distinction.

    Don't get me started on how unprofessional it is to mix in the word "Panic" here!

  2. changed the title [-]How do we handle emergency stop[/-] [+]How do we handle stop all[/+] on Sep 22, 2026
  3. fajinyuan commented on Sep 25, 2026

    @fajinyuan
    Contributor

    with regard to
    Give a hook in BlueAPI stop that runs regardless of if a plan is running
    My guess is you would like the BlueAPI stop to

    1. stop currently running plan
    2. configurable for beamline to add/configure actions to stop other devices
    3. not like the bad GDA 'Stop All' command which call stop on every Stoppables, but only call stop on listed devices or actions.
      In RunEngine there are 3 different kind stops
      RE.abort()
      RE.stop()
      RE.halt()
      which of these you want this issue's stop to call?

    Bluesky supports resuming a paused plan from its last checkpoint. It also distinguishes stop, abort, and halt: stop performs cleanup and records success, abort performs cleanup and records abortion, while halt does not give the plan an opportunity to clean up.

  4. DominicOram commented on Sep 28, 2026

    @DominicOram
    ContributorAuthor

    not like the bad GDA 'Stop All' command which call stop on every Stoppables, but only call stop on listed devices or actions.

    I think the default Bluesky behaviour is to call stop on any devices that have been staged in the plan. I wouldn't mind if the behaviour of BlueAPI was to call stop on all devices it knows about, we would just have to be careful that's clean.

    I think in this case it's probably an abort. We want to do cleanup e.g. close shutters and stop motors but it's shouldn't result in a successful end to a plan.

  5. fajinyuan commented on Nov 27, 2026

    @fajinyuan
    Contributor

    I think in this case it's probably an abort. We want to do cleanup e.g. close shutters and stop motors but it's shouldn't result in a successful end to a plan.

    this means 'halt' in blueskey terminology, not 'abort'.
    My interpretation of the following bluesky methods or commands (I didn't test these, so please test them to confirm when you have the ooportunity)
    For a step scan

    • stop : scan stops after current point is completed successfully, it ensures proper clean up, scan recorded as success, data is written correctly.
    • abort : scan stops immediately, current point is abundant, ensure proper clean up, scan recorded as aborted, data is written but only to the last successful completed point (not sure if number of scan data points correctly updated or not)
    • halt : scan stops immediately. no clean-up, scan recorded as halt, correctness of data writing is not ensured or may not write data at all.

    By default, these commands should only interact with devices that participate in the currently running plan! (This implies that if you want halt to close your shutter you have to ensure the shutter you want to close by halt is a device used in your running plan.)
    Alternatively blueapi might be able to provide a separate method or function, for example ' stop_plan_plus_other_device(plan, {})' for beamline to provide customisation they want. maybe there are better ways to do the same thing which I will leave this for debating.

    I don't like GDA's 'stop all' button as it is very slow to run through all GDA configured devices. In fact many of my beamlines have asked me to take this out of GDA client already. My question here is why you would like to call stop on devices that are not be used in the running plan?

    My personal view is it would be better if you want to close shutter when a plan is halted, you need to ensure the shutter is participating in your plan either explicitly or by default setting. But I am open to have a function (which can be triggered by UI button) to do this job outside the plan is running.

  6. added
    under-discussion
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    under-discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions