-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): configure instrs only if needed (#13085)
We've had this consistent problem with race conditions around cache_instruments, which gets called when something hits /instruments. It can reconfigure a bunch of internal data caches and also do things like change the active currents on the axes. We used to do this pretty often because it was the only time we actually checked what instruments were connected. We configured everything unconditionally. However, the app is basically always polling /instruments. That means that if a process is running - a protocol, a calibration - some app is going to hit /instruments and cause a current reconfiguration and anything that requires a specific current will break, for instance. This is bad! The fix is to add in a concept from the OT2, of only running a system reconfiguration if something actually changed since the last cache_pipette. It's really easy to make this comparison, since we cache stuff anyway - that's the point of cache pipette - and a lot of the worker functions we call during the process actually return a bool to let us know we can skip config anyway.
- Loading branch information
Showing
5 changed files
with
133 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.