Put missions on queue if ISAR already has a mission running #1879
Labels
backend
Backend related functionality
good first issue
Good for newcomers
improvement
Improvement to existing functionality
Northern Lights
Describe the improvement you would like to see
If we try to start a mission on ISAR and we get a 400 status code saying ISAR already has a mission, this could be caused by another Flotilla pod or thread already having started a mission. Currently we simply fail the mission we tried to schedule, but instead we should first verify whether the mission ISAR is already running is the one we tried to schedule (this would mean another thread already did the thing we wanted to do), in which case we ignore it, and if the mission in ISAR is different from the one we want to run, we should simply put the mission back on the queue.
This will require some minor changes in ISAR, since it currently doesn't report the current mission it is running if we try to run a mission when it is not in idle.
How will this change existing functionality?
It will improve concurrency between different Flotilla threads/instances. In the future, if we want to move the mission queue to ISAR instead of storing it in the Flotilla SQL database, then this would no longer be needed (equinor/isar#674).
How will this improvement affect the current Threat Model?
N/A
The text was updated successfully, but these errors were encountered: