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

Add a backend for waitable handles #68

Merged
merged 3 commits into from
Mar 30, 2024
Merged

Add a backend for waitable handles #68

merged 3 commits into from
Mar 30, 2024

Conversation

notgull
Copy link
Member

@notgull notgull commented Jan 15, 2024

This commit adds a new backend for the process reaper. Rather than
waiting on a signal, it instead registers the process's pidfd into
async-io and waits on that instead.

I've coded this backend to also allow for other systems to be registered
here as well.

cc #49

@fogti
Copy link
Member

fogti commented Jan 17, 2024

ok, the concept looks good overall, but I wasn't yet able to look through in detail.

@notgull
Copy link
Member Author

notgull commented Jan 25, 2024

I realized that pidfd was only introduced in v5.4 of the Linux kernel, while Rust 1.63's current minimum version is v2.6. So we might still need to keep in the signal backend at least as a fallback.

@notgull
Copy link
Member Author

notgull commented Feb 10, 2024

I realized that pidfd was only introduced in v5.4 of the Linux kernel, while Rust 1.63's current minimum version is v2.6. So we might still need to keep in the signal backend at least as a fallback.

This should be fixed as of now.

Signed-off-by: John Nunley <dev@notgull.net>
This commit adds a new backend for the process reaper. Rather than
waiting on a signal, it instead registers the process's pidfd into
async-io and waits on that instead.

I've coded this backend to also allow for other systems to be registered
here as well.

Signed-off-by: John Nunley <dev@notgull.net>
@notgull
Copy link
Member Author

notgull commented Mar 23, 2024

@smol-rs/admins Any chance this PR can be reviewed?

@notgull notgull requested a review from fogti March 26, 2024 04:09
src/lib.rs Outdated Show resolved Hide resolved
src/reaper/wait.rs Outdated Show resolved Hide resolved
As pidfd isn't available in older versions of Linux that Rust still
supports, this is necessary for running on older Linux. In addition,
signals tests are still kept in CI.

Signed-off-by: John Nunley <dev@notgull.net>
@notgull notgull merged commit bbd42b5 into master Mar 30, 2024
14 checks passed
@notgull notgull deleted the notgull/wait branch March 30, 2024 03:37
@notgull notgull mentioned this pull request Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants