diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-09-26 14:51:17 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-10-01 14:41:08 +0000 |
| commit | db09e5b2322f6dbd902a69405c2142617c6b8715 (patch) | |
| tree | 95938014c337f677b326cc97ae50e89c67a2e3e3 /vm | |
| parent | 9f36949b26d43c6ccbb08181c9d4452458d2c673 (diff) | |
vm/qemu: don't auto retry ssh connection timeout errors
In almost all cases these mean some boot time crash.
It also doesn't make much sense to continue string matching since the
boot output may contain the matched strings in benign contexts.
Diffstat (limited to 'vm')
| -rw-r--r-- | vm/qemu/qemu.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 63598d4bb..6714703fe 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -348,6 +348,12 @@ func (pool *Pool) Create(ctx context.Context, workdir string, index int) (vmimpl if err == nil { return inst, nil } + if strings.Contains(err.Error(), "can't ssh into the instance") { + // If there was a boot error, immediately return it. + // In this case, the string search below also matches against boot time output, + // and e.g. "Device or resource busy" is quite often in there. + return nil, err + } // Older qemu prints "could", newer -- "Could". if i < 1000 && strings.Contains(err.Error(), "ould not set up host forwarding rule") { continue @@ -358,6 +364,7 @@ func (pool *Pool) Create(ctx context.Context, workdir string, index int) (vmimpl if i < 1000 && strings.Contains(err.Error(), "Address already in use") { continue } + return nil, err } } |
