Backport of Task lifecycle restart into release/1.3.x #14312
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.
Backport
This PR is auto-generated from #14127 to be assessed for backporting due to the inclusion of the label backport/1.3.x.
WARNING automatic cherry-pick of commits failed. Commits will require human attention.
The below text is copied from the body of the original PR.
Following-up on the work done in #14009, this PR implements a new restart mode that allows for all tasks of an allocation to be restarted, even those that have already run, such as non-sidecar prestart or poststop tasks.
It also solves some related issues, such as the restart command failing with
Task not running
due to dead tasks in the allocation. These errors are now ignore when restarting the allocation (restarting a dead task with-task
will still result in this error).Closes #9464
Closes #9688
Closes #9841
Note to reviewers: The internal RFC proposed a new task state (
complete
) to differentiate between a task that is reallydead
(and would never run again) from that a task that finished running, but is waiting for a restart.But during implementation I noticed that there are quite a few places where the
dead
state was being checked, but then I also noticed that it didn't really matter if the task wasdead
orcomplete
so I was able to implement this functionally without the need for the extra state.