[Webservice] Check for unfinished corrections before launching a new one
Description
Issues in myMdC caused it to send two requests to correct the same run in quick succession. This will hopefully be fixed, but it's happened before, and we want to protect against it in the webservice too.
How Has This Been Tested?
Deployed on max-exfl017, used the update_mdc
script to trigger two requests quickly (change status to R, then NA, then R again).
Logs from the webservice:
2023-04-19 15:53:08,560 - root - DEBUG - [webservice.py:904] Running action correct, payload ['63613', 'sase1', 'CALLAB', '202031', '900113', '9993', '2']
...
2023-04-19 15:53:21,389 - root - DEBUG - [webservice.py:331] DB change (Insert jobs): 1.4 ms in transaction, 7.2 ms commit
2023-04-19 15:53:21,389 - root - INFO - [webservice.py:386] SUCCESS: Started correction: proposal 900113, run 9993
...
2023-04-19 15:53:59,207 - root - INFO - [webservice.py:903] Handling request for action correct
2023-04-19 15:53:59,208 - root - DEBUG - [webservice.py:904] Running action correct, payload ['63613', 'sase1', 'CALLAB', '202031', '900113', '9993', '2']
2023-04-19 15:53:59,209 - root - DEBUG - [webservice.py:1408] Loading config for cycle 202031, proposal 900113 from /home/xcaltst/calibration_config/202031/900113.yaml
2023-04-19 15:53:59,240 - root - DEBUG - [webservice.py:969] SUCCESS: Correction already queued/running for proposal 900113, run 9993
2023-04-19 15:53:59,240 - root - DEBUG - [webservice.py:882] Sending response: b'SUCCESS: Correction already queued/running for proposal 900113, run 9993'
Types of changes
- Bug fix (non-breaking change which fixes an issue)
Checklist:
- My code follows the code style of this project.