From bdb7b93f25823c4a76d03592ab4c2baa7c30a1b9 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 18 Mar 2019 10:52:18 +0100 Subject: pkg/osutil: kill subprocesses more reliably In some cases we start scp, which starts ssh, then kill scp but the ssh subprocess is not killed. As the result cmd.Wait hangs waiting for EOF on the stdout/stderr, which are still kept alive by ssh subprocess. But ssh just hangs forever. Create a process group for each command and kill whole process group. Hopefully this will help. --- pkg/osutil/osutil_appengine.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/osutil/osutil_appengine.go') diff --git a/pkg/osutil/osutil_appengine.go b/pkg/osutil/osutil_appengine.go index ce2938a24..6c3888dbf 100644 --- a/pkg/osutil/osutil_appengine.go +++ b/pkg/osutil/osutil_appengine.go @@ -19,3 +19,6 @@ func SandboxChown(file string) error { func setPdeathsig(cmd *exec.Cmd) { } + +func killPgroup(cmd *exec.Cmd) { +} -- cgit mrf-deployment