Skip to content

Commit b11d137

Browse files
fix(procmgr): terminate residual job members before deferred drain
When the root child exits while descendants remain in the supervision job, call TerminateJobObject before retaining the job handle for async profile unload so KILL_ON_JOB_CLOSE is not the only way to reap lingering members.
1 parent c48f8b1 commit b11d137

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/procmgr/rust/src/process.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ impl ManagedProcess {
239239
}
240240
Ok(_) => {
241241
if let (Some(pid), Some(profile)) = (exited_pid, self.user_profile.take()) {
242+
if let Err(e) = job.terminate() {
243+
warn!(
244+
"[{}] failed to terminate residual job members before deferred drain (pid {}): {e:#}",
245+
self.name, pid
246+
);
247+
}
242248
let job = self.job_object.take();
243249
info!(
244250
"[{}] deferring profile unload until job members exit (pid {})",

0 commit comments

Comments
 (0)