Skip to content

Commit

Permalink
fix: remove Drop for SpawnProcessOnDemand. (#450)
Browse files Browse the repository at this point in the history
It is well-intended but is likely to hang the calling process
if for any reason not all process output was consumed.

Even though not waiting for the process leaves it running, it will
stop naturally once its output pipe breaks once once
our handles for it are inevitable dropped at the same time.
  • Loading branch information
Byron committed Oct 3, 2022
1 parent f10a3e0 commit 6d8b66a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions git-transport/src/client/blocking_io/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ pub struct SpawnProcessOnDemand {
child: Option<process::Child>,
}

impl Drop for SpawnProcessOnDemand {
fn drop(&mut self) {
if let Some(mut child) = self.child.take() {
child.wait().ok();
}
}
}

impl SpawnProcessOnDemand {
pub(crate) fn new_ssh(
url: git_url::Url,
Expand Down

0 comments on commit 6d8b66a

Please sign in to comment.