Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: On Windows, use job for upload-pack child
✗ CI failure Lorenz Leutgeb committed 2 months ago
commit 9d8311668f98c38c79122967514cb9d96ca69789
parent b81ab621cf39376049162d110e63eecdf4810597
1 failed (1 total) View logs
4 files changed +13 -2
modified CHANGELOG.md
@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
  but marks an escape sequence on Unix-like systems), which lead to issues when
  attempting to execute child processes.
  This is fixed by using `winsplit` on Windows instead.
+
- On Windows, zombie `git-upload-pack` processes are now prevented by using the
+
  "Job" API of the operating system to group child processes and their children.

## Deprecations

modified Cargo.lock
@@ -3060,6 +3060,7 @@ dependencies = [
 "radicle-protocol",
 "radicle-signals",
 "radicle-systemd",
+
 "radicle-windows",
 "scrypt",
 "serde",
 "serde_json",
modified crates/radicle-node/Cargo.toml
@@ -48,6 +48,7 @@ radicle-systemd = { workspace = true, optional = true }

[target.'cfg(windows)'.dependencies]
winpipe = { workspace = true }
+
radicle-windows = { workspace = true }

[dev-dependencies]
mio = { version = "1", features = ["os-ext"] }
modified crates/radicle-node/src/worker/upload_pack.rs
@@ -84,6 +84,9 @@ where
        cmd.spawn()?
    };

+
    #[cfg(windows)]
+
    let job = radicle_windows::jobs::Job::for_child(&child)?;
+

    let mut stdin = child.stdin.take().unwrap();
    let mut stdout = io::BufReader::new(child.stdout.take().unwrap());
    let reporter = std::sync::Mutex::new(Reporter::new(header.repo, remote, emitter.clone(), send));
@@ -150,8 +153,12 @@ where
        if let Err(e) = reader.join() {
            log::warn!(target: "worker", "Upload pack thread panicked: {e:?}");
        }
-
        child.kill()?;
-
        Ok::<_, io::Error>(())
+

+
        #[cfg(unix)]
+
        return child.kill();
+

+
        #[cfg(windows)]
+
        return job.terminate(3);
    })?;

    let status = child.wait()?;