fix: error recovery after retry fail #795
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Follow up of #762. Pending tasks should also be finalized (and inserted into the queue).
Description
During retry process when a task produces an exception, the retry may fail during insertion into the queue system or setting the task to Submitted. When this happen, the task in retried may stay into the queue and re-acquired. We check if the retried task (the new instance) exists and if it exists whith status Creating or Submitted, we finalize its creation. This PR adds also finalize creation of tasks with status Pending.
Testing
Unit tests were added to validate were resubmit properly when the new instance of the task in error is Pending.
Impact
Should fix part of the issue where tasks stay in Pending or Submitted whitout being processed.
Additional Information
We need to try other queue systems to see if the same issue occur with them.
Checklist