Revision 66bd7445
ID | 66bd7445ed6e1e7200c28d0dfd42ba1365352eb2 |
jqueue: Fix potential race condition when cancelling queued jobs
When a job was cancelled, its status would be changed and the file
written again. Since this was a final status, the job file could be
moved anytime for archival. If the job was still in the queue, however,
it would be processed (not fully, just updating the “end_timestamp”
attribute) and written again. This was bad as it could leave the same
job in two different files.
With this patch the processor is changed to return early for finished
jobs. Cancelling a queued job will finalize it right away. Unittests are
updated.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Files
- added
- modified
- copied
- renamed
- deleted