fix(#2560): kill_on_drop for git + nix children so timeouts don't orphan

This commit is contained in:
damocles 2026-07-17 15:04:33 +02:00
commit 40cf7f29de
2 changed files with 12 additions and 1 deletions

View file

@ -1391,6 +1391,10 @@ async fn nix_output(dir: &Path, args: &[&str]) -> Result<std::process::Output> {
Command::new("nix")
.current_dir(dir)
.args(nix_argv(args))
// Kill the nix child if the caller's future is dropped (e.g. the
// startup-migration timeout around `sync_agents` fires) rather than
// orphaning it against an unreachable forge. No-op on normal exit.
.kill_on_drop(true)
.output()
.await
.with_context(|| format!("nix {} in {}", args.join(" "), dir.display()))