ISISComputingGroup / ISISComputingGroup/IBEX

Pydev/nicos/ipython: warn against concurrent execution

Open
#8,696 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
6
Forks
2
Avg merge
16h 40m
Merged PRs (30d)
2

Description

As an instrument scientist on HIFI I would like it to be harder to accidentally run two python scripts which are both trying to set magnets/temperatures/do runs concurrently, where one is in nicos, server-side, and the other is in pydev or a standalone python shell, client-side.

It's not necessarily obvious where to put this check if we want it to be robust, e.g. if my local client is executing a script locally in pydev, and some other client elsewhere (which would have no knowledge of my locally-running script) then schedules a script to execute via script server, where would a check catch that and which one would win?

### Notes

- We might be able to detect that pydev is "busy" (i.e. hasn't returned to prompt) and display a "running" icon on the perspective switcher if so - similar to what we do with nicos already. But not clear that there'll be a nice pydev api for this. And it still only really catches the single-client case - but that might be better than nothing.
- We may be able to warn on a best-effort basis in the client in the case where it happens to be the same client, on the same machine, running two scripts concurrently. Would a warning in some scenarios, but not all, lead to a false sense of security?
- Various beamlines have use-cases where two scripts run at the same time - usually this is one in a standalone python window and the other in pydev but could be different combinations. e.g. https://github.com/isiscomputinggroup/ibex/issues/6673 is one request to run multiple scripts concurrently _within_ nicos. We need to make sure we don't make running multiple scripts concurrently impossible, just more obvious.
- Baton-passing based on "who has control" - of the type suggested in https://github.com/isiscomputinggroup/ibex/issues/55 - is unlikely to _directly_ help here, as the client and server happen to be the same machine in some cases.

### Acceptance criteria

- It is more obvious when two scripts are running concurrently, one in pydev and the other in nicos
- It is still *possible* to run two scripts as above as some beamlines have use-cases for this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.