Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of Fix task leak during client restore when allocrunner prerun hook fails into release/1.3.x #17119

Conversation

hc-github-team-nomad-core
Copy link
Contributor

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 same TaskRunner.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?

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/b-restore-prerun-error-task-leak/notably-verified-beetle branch 2 times, most recently from 88eb3c2 to 53670de Compare May 8, 2023 18:17
@hashicorp-cla
Copy link

hashicorp-cla commented May 8, 2023

CLA assistant check
All committers have signed the CLA.

plus MinJob and MinAlloc mocks in nomad/mock/
* they're separated into job.go and alloc.go, like 1.4.x,
  but other job/alloc mocks remain in mock.go
@gulducat gulducat merged commit 646ce13 into release/1.3.x May 10, 2023
@gulducat gulducat deleted the backport/b-restore-prerun-error-task-leak/notably-verified-beetle branch May 10, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants