-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: terminate spawned processes when the deno task process is terminated on Windows #35
feat: terminate spawned processes when the deno task process is terminated on Windows #35
Conversation
…nated on Windows Closes denoland#33
src/child_process_tracker.rs
Outdated
let handle = CreateJobObjectW(ptr::null_mut(), ptr::null()); | ||
let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = std::mem::zeroed(); | ||
info.BasicLimitInformation.LimitFlags = | ||
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add JOB_OBJECT_LIMIT_BREAKAWAY_OK | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK
.
This allows subprocesses to spawn other programs that run in the background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Added all three.
If you need ideas...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (but see comments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have a test for this in the CLI here: denoland/deno#14421 -- I wasn't sure how to test this here.
This uses the jobs api in Windows in order to accomplish this.
Closes #33