diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-22 18:37:02 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-22 18:37:02 +0200 |
| commit | 412bfd3c5813a9e677f3ca41c330656a9b0415e7 (patch) | |
| tree | 3e3b90e26039b374a7f99b1f36263b29fc9b5097 /vm/gvisor | |
| parent | b5323c280fc9dd0ed10db3b4b9e7c44e56c60d07 (diff) | |
vm/gvisor: use timeout for all runsc invocations
runsc likes to hang dead. Add timeouts to all invocations.
Diffstat (limited to 'vm/gvisor')
| -rw-r--r-- | vm/gvisor/gvisor.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go index eaef58969..9118d1fb6 100644 --- a/vm/gvisor/gvisor.go +++ b/vm/gvisor/gvisor.go @@ -111,7 +111,7 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) { } // Kill the previous instance in case it's still running. - inst.runscCmd("delete", "-force", inst.name).CombinedOutput() + osutil.Run(time.Minute, inst.runscCmd("delete", "-force", inst.name)) time.Sleep(3 * time.Second) cmd := inst.runscCmd("run", "-bundle", bundleDir, inst.name) @@ -187,11 +187,11 @@ func (inst *instance) runscCmd(add ...string) *exec.Cmd { func (inst *instance) Close() { time.Sleep(3 * time.Second) - inst.runscCmd("delete", "-force", inst.name).CombinedOutput() + osutil.Run(time.Minute, inst.runscCmd("delete", "-force", inst.name)) inst.cmd.Process.Kill() inst.merger.Wait() inst.cmd.Wait() - inst.runscCmd("delete", "-force", inst.name).CombinedOutput() + osutil.Run(time.Minute, inst.runscCmd("delete", "-force", inst.name)) time.Sleep(3 * time.Second) } @@ -308,7 +308,7 @@ func (inst *instance) guestProxy() (*os.File, error) { } func (inst *instance) Diagnose() bool { - inst.runscCmd("debug", "-stacks", inst.name).CombinedOutput() + osutil.Run(time.Minute, inst.runscCmd("debug", "-stacks", inst.name)) return true } |
