From 88f20b7bcc1efa00cb8e88f426cbea7ef4c3dd6e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 19 Sep 2018 13:37:41 +0200 Subject: vm/vmm: increase timeouts A dozen of vmm's running on a GCE machine can be really slow to boot. Timeouts have only single goal: preventing complete system stalls when/if external commands episodically hang. There is no value in keeping them as close as possible to expected durations. This can only lead to various flakes. Increase timeouts by an order of magnitude. --- vm/vmm/vmm.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vm/vmm') diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go index 5dce85eef..93ee45583 100644 --- a/vm/vmm/vmm.go +++ b/vm/vmm/vmm.go @@ -183,13 +183,13 @@ func (inst *instance) Boot() error { select { case ip := <-ipch: inst.sshhost = ip - case <-time.After(1 * time.Minute): + case <-time.After(10 * time.Minute): bootOutputStop <- true <-bootOutputStop return vmimpl.BootError{Title: "no IP found", Output: bootOutput} } - if err := vmimpl.WaitForSSH(inst.debug, 2*time.Minute, inst.sshhost, + if err := vmimpl.WaitForSSH(inst.debug, 20*time.Minute, inst.sshhost, inst.sshkey, inst.sshuser, inst.os, inst.sshport); err != nil { bootOutputStop <- true <-bootOutputStop @@ -220,7 +220,7 @@ func (inst *instance) Copy(hostSrc string) (string, error) { if inst.debug { log.Logf(0, "running command: scp %#v", args) } - _, err := osutil.RunCmd(3*time.Minute, "", "scp", args...) + _, err := osutil.RunCmd(10*time.Minute, "", "scp", args...) if err != nil { return "", err } @@ -288,7 +288,7 @@ func (inst *instance) Diagnose() bool { for _, c := range commands { select { case inst.diagnose <- c: - case <-time.After(2 * time.Second): + case <-time.After(5 * time.Second): } } return true @@ -353,7 +353,7 @@ func (inst *instance) vmctl(args ...string) (string, error) { if inst.debug { log.Logf(0, "running command: vmctl %#v", args) } - out, err := osutil.RunCmd(10*time.Second, "", "vmctl", args...) + out, err := osutil.RunCmd(time.Minute, "", "vmctl", args...) if err != nil { if inst.debug { log.Logf(0, "vmctl failed: %v", err) -- cgit mrf-deployment