Commit Graph

57 Commits

Author SHA1 Message Date
John Nunley a9e4b09a6e
v2.2.2
Signed-off-by: John Nunley <dev@notgull.net>
2024-04-20 12:19:56 -07:00
John Nunley 7323b449d7
v2.2.1
Signed-off-by: John Nunley <dev@notgull.net>
2024-04-13 22:18:58 -07:00
John Nunley 581c0a02c0 v2.2.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-03-30 09:12:08 -07:00
John Nunley bbd42b56f8 feat: Allow fallback to signal backend
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>
2024-03-29 20:37:31 -07:00
John Nunley 1e0751fe65 feat: Add a waitable process backend for Linux
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>
2024-03-29 20:37:31 -07:00
John Nunley ed17f53035 v2.1.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-02-18 08:47:04 -08:00
John Nunley b6c1ddea79 chore: Bump event-listener to v5.1.0
https://github.com/smol-rs/async-process/pull/70#issuecomment-1950955967

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-17 22:03:44 -08:00
John Nunley 35a77ff266
m: Port to event-listener v5.0.0
cc smol-rs/event-listener#104

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-12 06:26:10 -08:00
John Nunley d23ab0b6a3
v2.0.1
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-24 07:48:05 -08:00
dependabot[bot] 0357928248 Update windows-sys requirement from 0.48 to 0.52
Updates the requirements on [windows-sys](https://github.com/microsoft/windows-rs) to permit the latest version.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.48.0...0.52.0)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 22:24:19 +09:00
John Nunley d0993f8d0b
m: Bump to event-listener v4.0.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-19 12:51:15 -08:00
John Nunley 90f343f0ad
v2.0.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-31 18:26:06 -07:00
dependabot[bot] 54647bef65 Update async-lock requirement from 2.6.0 to 3.0.0
Updates the requirements on [async-lock](https://github.com/smol-rs/async-lock) to permit the latest version.
- [Release notes](https://github.com/smol-rs/async-lock/releases)
- [Changelog](https://github.com/smol-rs/async-lock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-lock/compare/v2.6.0...v3.0.0)

---
updated-dependencies:
- dependency-name: async-lock
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 10:38:54 +09:00
dependabot[bot] 297ac50224 Update futures-lite requirement from 1.11.0 to 2.0.0
Updates the requirements on [futures-lite](https://github.com/smol-rs/futures-lite) to permit the latest version.
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v1.11.0...v2.0.0)

---
updated-dependencies:
- dependency-name: futures-lite
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 10:34:17 +09:00
John Nunley 65cde366d4
Bump async-io to v2.0.0 and async-channel to v2.0.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-28 19:04:54 -07:00
John Nunley f733a83c22
feat: Add a way to run without the async-process thread
I know I said that I wouldn't add any more features, but I
think this is important enough.

Right now, a thread called "async-process" is responsible for listening
for SIGCHLD and reaping zombie processes. This listens for the SIGCHLD
signal in Unix and uses a channel connected to the waitable handle on
Windows. While this works, we can do better. Through async-signal, the
signal was already asynchronous on Unix; we were already just using
async_io::block_on to wait on the signal. After swapping out the channel
used on Windows with async-channel, the process reaping function "reap"
can be reimplemented as a fully asynchronous future.

From here we must make sure this future is being polled at all times. To
facilitate this, a function named "driver()" is added to the public API.
This future acquires a lock on the reaper structure and calls the
"reap()" future indefinitely. Multiple drivers can be created at once;
they will just wait forever on this lock. This future is intended to be
spawned onto an executor and left to run forever, making sure all child
processes are signalled whenever necessary. If no tasks are running the
driver future, the "async-process" thread is spawned and runs the
"reap()" future itself.

I've added the following controls to make sure that this system is
robust:

- If a "driver" task is dropped, another "driver" task will acquire the
  lock and keep the reaper active.
- Before being dropped, the task checks to see if it is the last driver.
  If it is, it will spawn the "async-process" thread to be the driver.
- When a Child is being created, it checks if there are any active
  drivers. If there are none, it spawns the "async-process" thread
  itself.
- One concern is that the driver future wil try to spawn the
  "async-process" thread as the application exits and the task is being
  dropped, which will be unnecessary and lead to slower shutdowns. To
  prevent this, the future checks to see if there are any extant `Child`
  instances (a new refcount is added to Reaper to facilitate this). If
  there are none, and if there are no zombie processes, it does not
  spawn the additional thread.
- Someone can still `mem::forget()` the driver thread. This does not
  lead to undefined behavior and just leads to processes being left
  dangling. At this point they're asking for wacky behavior.

This strategy might also be viable for `async-io`, if we want to try to
avoid needing to spawn the additional thread there as well.

Closes #7
cc smol-rs/async-io#40

Signed-off-by: John Nunley <dev@notgull.net>
2023-10-10 17:47:46 -07:00
Taiki Endo 9f9351bc52
Migrate to Rust 2021 (#58) 2023-10-08 14:56:48 +09:00
John Nunley 513b9262d7
v1.8.1
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-07 18:48:22 -07:00
John Nunley ce7ded77e8
bugfix: Bump async-signal to v0.2.3
Extracted from #54, should fix #55

Signed-off-by: John Nunley <dev@notgull.net>
2023-10-05 19:02:10 -07:00
John Nunley 78342ab1db
v1.8.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-25 09:58:59 -07:00
John Nunley 5e8e0b7c7b
Upgrade to event-listener v3.0.0 (#43)
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-10 12:57:24 -07:00
dependabot[bot] 1715616859
m: Update rustix requirement from 0.37 to 0.38
Updates the requirements on [rustix](https://github.com/bytecodealliance/rustix) to permit the latest version.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.37.0...v0.38.2)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 19:05:21 -07:00
John Nunley d45d6f1094
Use async-signal instead of signal-hook (#42) 2023-06-11 11:21:40 -07:00
Taiki Endo 7eb60b1025 Bump MSRV to 1.63 2023-06-11 22:26:44 +09:00
John Nunley 5e48a40d6c
v1.7.0 (#41) 2023-04-07 10:47:16 -07:00
Taiki Endo 01e36f4abe Update windows-sys to 0.48 2023-04-04 03:46:36 +09:00
John Nunley e41847a378
ex: Add example for timed out process (#38) 2023-03-19 06:44:10 -07:00
dependabot[bot] 9f57bbfeb7 Update rustix requirement from 0.36 to 0.37
Updates the requirements on [rustix](https://github.com/bytecodealliance/rustix) to permit the latest version.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.36.0...v0.37.1)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 12:14:46 +09:00
dependabot[bot] e84c3fd53c Update windows-sys requirement from 0.42 to 0.45
Updates the requirements on [windows-sys](https://github.com/microsoft/windows-rs) to permit the latest version.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.42.0...0.45.0)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 11:32:45 +09:00
Taiki Endo 93be5c2506 Replace direct dependency on libc with rustix 2022-12-30 13:43:50 +09:00
Taiki Endo 2a2c1ee34a Bump MSRV to 1.47
On Windows, we depend on blocking and async-task that require Rust 1.47.
2022-12-28 12:44:10 +09:00
Taiki Endo 580be7ee06 Release 1.6.0 2022-11-27 16:39:21 +09:00
John Nunley de1071784e
Port to windows-sys (#27) 2022-11-26 21:14:01 -08:00
Taiki Endo f835f75f39 Fix build failure with minimal-versions 2022-11-27 13:31:38 +09:00
John Nunley a44d0b418a
Port from once-cell to async-lock (#26) 2022-11-27 12:43:59 +09:00
Taiki Endo 00f30f09e2 Release 1.5.0 2022-08-21 18:24:34 +09:00
John Nunley 8dda23e06b
Add `AsRawFd`/`AsFd` to the `ChildStd*` types (#23)
* add asrawfd/asfd impls

* fmt
2022-08-17 17:42:17 -07:00
Taiki Endo 2e0881f64d Bump to v1.4.0 2022-05-01 13:57:48 +09:00
Taiki Endo 6beffb4373 Clean up CI config 2022-01-08 22:03:15 +09:00
Taiki Endo 327f176ba4 Bump to v1.3.0 2021-11-10 20:40:38 +09:00
Taiki Endo fa4ab47e97 Bump to v1.2.0 2021-08-07 16:51:24 +09:00
Taiki Endo 0da238915e Bump to v1.1.0 2021-04-24 17:45:31 +09:00
BinCheng 7d9dc0b914
Adding the `into_stdio` make async-process more flexible. (#13) 2021-04-24 17:39:11 +09:00
Taiki Endo e38b5f843a Remove readme field from Cargo.toml 2021-02-14 19:43:45 +09:00
Stjepan Glavina 16b78764ae Bump to v0.1.2 2021-02-05 21:03:55 +01:00
Taiki Endo b83f51aa7f
Merge pull request #4 from ooesili/update-signal-hook
Update signal-hook to version 0.3.0
2020-12-29 20:01:12 +09:00
Taiki Endo f17226fcbd Update URLs 2020-12-26 23:47:13 +09:00
Wesley Merkel ae865efb27 Update signal-hook to version 0.3.0
The dependency on version v0.1.16 of signal-hook makes this library
impossible to use in a project alongside signal-hook version v0.3.0.
This is caused by an arguably incorrect dependency from signal-hook
v0.1.16 on `~1.2` of signal-hook-registry (I think it should just depend
on `^1.2` instead), however it seemed more beneficial overall to upgrade
this crate's dependency instead.
2020-12-25 05:05:12 -06:00
Marc-Antoine Perennou 166679449d update cfg-if
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-11-06 11:36:48 +01:00
Stjepan Glavina 090f6eec39 Bump to v1.0.1 2020-10-09 14:38:18 +02:00