Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
7: Wait for all processes in the process group r=passcod a=malyn This avoids zombie processes that would otherwise be created if the child process exits after spawning its own children, but without waiting for those children to exit. This change ensures that `wait` reaps all of those zombie processes, while still returning the exit code from the original process that was spawned (Command Group's direct child). One note: I wasn't entirely sure if this should be in Command Group or in my application code, but the documentation of the [`AsyncGroupChild::wait`](https://docs.rs/command-group/1.0.8/command_group/struct.AsyncGroupChild.html#method.wait) function suggested that cleaning up all of the children in the process *group* might have been what was intended: > Waits for the child group to exit completely, returning the status that the process leader exited with. The Tokio code does not perform this reaping though, and I realize that Command Group is ultimately based on the Tokio API, so, as I said, not entirely sure if this is the right place for this logic. Co-authored-by: Michael Alyn Miller <malyn@strangeGizmo.com>
- Loading branch information
Showing
2 changed files
with
84 additions
and
17 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