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 windows: set job object for executor and children into release/1.9.x #24226

Conversation

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

Backport

This PR is auto-generated from #24214 to be assessed for backporting due to the inclusion of the label backport/1.9.x.

The below text is copied from the body of the original PR.


On Windows, if the raw_exec driver's executor exits, the child processes are not also killed. Create a Windows "job object" (not to be confused with a Nomad job) and add the executor to it. Child processes of the executor will inherit the job automatically. When the handle to the job object is freed (on executor exit), the job itself is destroyed and this causes all processes in that job to exit.

Fixes: #23668
Ref: https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects

Note: automated testing for this will need to be end-to-end but we're not running Windows on nightly anymore. I've verified the behavior works as expected using Process Explorer. Killing the executor kills all child processes as expected. Killing the root child process causes the executor to exit (as usual) and that in turn kills any child processes that didn't exit already.

Edit: added tests, which requires changing what runs in CI as well


Overview of commits

@tgross tgross merged commit 17515cc into release/1.9.x Oct 16, 2024
20 checks passed
@tgross tgross deleted the backport/windows-executor-orphan/miserably-flexible-quail branch October 16, 2024 13:39
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.

2 participants