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

feature(process): Use pidfd on Linux for tokio::process::Child::wait #6152

Merged
merged 17 commits into from
Jan 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix leaked sleep process in test_pidfd_reaper_drop
Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu committed Jan 11, 2024
commit dc889e36b428aa1c17682d185a386b87b3511e5c
8 changes: 6 additions & 2 deletions tokio/src/process/unix/pidfd_reaper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,15 @@ mod test {

let queue = MockQueue::new();

let mut child = Command::new("sleep").arg("1800").spawn().unwrap();

run_test(async {
let child = Command::new("sleep").arg("1800").spawn().unwrap();
let _pidfd_reaper = PidfdReaper::new(child, &queue).unwrap();
let _pidfd_reaper = PidfdReaper::new(&mut child, &queue).unwrap();
});

assert_eq!(queue.all_enqueued.borrow().len(), 1);

child.kill().unwrap();
child.wait().unwrap();
}
}
Loading