Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the
execmanager.submit_calculation
idempotent'ish
The `submit_calculation` is responsible for submitting a job, that was already uploaded to the remote machine, to the scheduler. There was a risk of the daemon submitting the same job twice. If the first time around it successfully submitted the job and set the job id as an attribute on the node, but then was interrupted (for example due to a shutdown) before it could transition the `CalcJob` to the `UPDATE` transport task, once reloaded the command would be executed again. This would not complain and simply submit the job again to the scheduler. This is both a waste of resources and can cause various complications. It is impossible to make the function fully idempotent, but by checking if the job id attribute is already set for the node at the beginning and returning it should minimize the risk of double submission.
- Loading branch information