-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Add PidFd::{kill, wait, try_wait} #124101
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
Conversation
|
If you call |
|
Good point. It shouldn't break it immediately since the pid won't be recycled until the fd is dropped (not confident, haven't tested this). But once one does drop it, yeah it'd become an issue. But people do want to take out pidfds, e.g. for process management in tokio. |
|
I've replaced |
This comment has been minimized.
This comment has been minimized.
|
OK, At the very least, this should be an unresolved question on the tracking issue. Apart from that, |
|
Yes it'll be lost but in those cases calling I'll note it in the tracking issue. @bors r=cuviper rollup |
|
@bors rollup=iffy |
As long as a pidfd is on a child it can be safely reaped. Taking it would mean the child would now have to be awaited through its pid, but could also be awaited through the pidfd. This could then suffer from a recycling race.
|
fixed the import, docs build for x86_64-pc-windows-gnu @bors r=cuviper |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test failed - checks-actions |
|
@bors retry |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (10e1f5d): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 693.147s -> 695.587s (0.35%) |
#117957 changed
Childkill/wait/try_wait to use its pidfd instead of the pid, when one is available.This PR extracts those implementations and makes them available on
PidFddirectly.The
PidFdimplementations differ significantly from the correspondingChildmethods:Childunless something stole the zombie childExitStatusis not kept, meaning that only the first time a wait succeeds it will be returnedwaitdoes not close stdinwaitonly requires&selfinstead of&mut selfsince there is no state to maintain and subsequent calls are safeTracking issue: #82971