Skip to content

Commit

Permalink
Prevent zombies in --exec-exit-on-disconnect mode.
Browse files Browse the repository at this point in the history
Addresses #196.
  • Loading branch information
vi committed Sep 17, 2023
1 parent 734cc58 commit 56ba844
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/process_peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ impl AsyncWrite for ProcessPeer {

impl Drop for ForgetfulProcess {
fn drop(&mut self) {
use futures::Future;
let mut chld = self.chld.take().unwrap();
if self.exit_on_disconnect {
debug!("Forcing child process to exit");
Expand All @@ -288,9 +289,12 @@ impl Drop for ForgetfulProcess {
warn!("Error terminating child process: {}", e);
}
}
drop(chld);
tokio::spawn(
chld.map(|_exc: ExitStatus| {

}).map_err(|_|())
);
} else {
use futures::Future;
tokio::spawn(
chld.map(|exc: ExitStatus| {
if exc.success() {
Expand Down

0 comments on commit 56ba844

Please sign in to comment.