Skip to content

fix(ssh): retry WaitForSSH every 500ms instead of 3s - #965

Merged
cdalar merged 1 commit into
mainfrom
fix/fc-waitforssh-fast-retry
Jul 10, 2026
Merged

cdalar merged 1 commit into
mainfrom
fix/fc-waitforssh-fast-retry

Conversation

@cdalar

@cdalar cdalar commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • WaitForSSH (used by the fc provider to detect when a freshly-booted microVM's sshd is up) slept a fixed 3s between failed dial attempts. Since sshd on Firecracker microVMs is typically reachable well under 3s after boot, this added ~2-2.5s of pure waiting on top of real boot time on every onctl create.
  • Dropped the retry interval to 500ms so the loop converges close to actual readiness instead of a coarse 3s step.

Test plan

  • go build ./... and go test ./internal/tools/... pass
  • Measured directly on fc-host with the onctl-4 profile (4vcpu/16GB, baked runner-base-docker.ext4), back-to-back same-config runs:
    • unpatched: onctl create → 4.54s
    • patched: onctl create → 2.58s
  • Confirmed via onctl list/onctl destroy that test VMs were cleaned up and no production runners were disturbed

https://claude.ai/code/session_01XkRavfuW3YnmPieWTrgffn

WaitForSSH polls the guest's SSH port after boot, sleeping a fixed 3s
between failed dial attempts. On Firecracker microVMs, sshd typically
comes up well under 3s after boot, so the poll loop's coarse interval
was adding ~2-2.5s of pure waiting on top of actual boot time.

Measured on fc-host with the onctl-4 profile (4vcpu/16GB, baked
runner-base-docker.ext4 image): `onctl create` dropped from 4.54s to
2.58s with this change, back-to-back, same VM config.
@cdalar
cdalar marked this pull request as ready for review July 10, 2026 13:22
@cdalar
cdalar merged commit fffc077 into main Jul 10, 2026
11 of 13 checks passed
@cdalar
cdalar deleted the fix/fc-waitforssh-fast-retry branch July 10, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址