Backport of Fix task leak during client restore when allocrunner prerun hook fails into release/1.3.x #17119
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 #17104 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.
Fixes #17102 -- I describe the issue more fully there.
My approach here is to stop skipping over
allocRunner.runTasks()
on prerun error. That way, instead of duplicating more cleanup code, which may change in the future, the sameTaskRunner.Run()
code that usually handles task cleanup can do what it needs to as appropriate with tasks that fail prerun during the alloc restore process.In pursuit of that, I made an error-inducing
FailHook
and added the ability to include it as part of client Config for the client integration test. I could remove the non-Prerun interface implementations, but I figured while I'm at it, may as well make a thing that can be induced to fail at any stage in case it's useful?