forked from tokio-rs/tokio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process: kill child on error while spawning
There's a chance that between spawning of the `std Child`, and wrapping it into a tokio impl an error can occurs, which would leave the child alive, with no way to access it from the user side and not being part of the tokio runtime. This commit fixes that issue by wrapping the `std Child` right after spawning with a struct that implements Drop, where the child would be killed if it's dropped. Fixes: tokio-rs#6797
- Loading branch information
Showing
2 changed files
with
132 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters