Flaky firecracker CI: parallel jobs reboot the shared infra-VM singleton (blocks kvm runner parallelization) #425
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Running more than one firecracker bottle test in parallel on the
delphi-kvmrunner is unsafe. Parallel jobs share the per-host infra-VM singleton, and one job can reboot it out from under the others, causing flaky failures. As an immediate mitigation the kvm runner has been pinned tocapacity = 1ingitea-runner.nix(serializes bottle tests). This issue tracks the real fix so we can restore parallelism.Symptoms (as seen in CI)
tests/integration/test_sandbox_escape.py, firecracker backend:test_3_http_exfil_blocked— egress proxy10.244.0.0:9099fails with a ~3s connect timeout.test_5_readme_push_blocked— git push to10.244.0.0:9420returnsrepository '.../throwaway.git/' not found; gitleaks never runs.These are not an nft/netpool misconfiguration — verified on delphi that the CI netpool unit, table names (
bot_bottle_fc_ci), the byte-identical bring-up script, and thebbci* :9099,9100,9420 -> 10.244.255.1DNAT are all correct and persistent.Root cause
capacity = 2), each running the full suite.bot_bottle/backend/firecracker/infra_vm.py: ensure_running). The gateway data plane is correctly multi-tenant (git-gate namespaced by uniquebottle_id; egress attributed per guest /31 IP), so shared state is fine.ensure_running()calls_adoptable(key, url, want); when it returns False the job takes the singleton lock and callsstop()+boot()— destroying the VM other in-flight jobs are using._adoptablereturns False when EITHER:booted != want, wherewant = infra_artifact_version()is a content hash of the wholebot_bottlepackage + Dockerfiles + init (infra_artifact.py). Parallel jobs on different commits (two PRs, or PR vs main) disagree on the version and reboot-ping-pong the VM; OR_health_ok(url)— a single 1.0s probe — flakes under concurrent boot load./git/<bottle_id>/repos (→ 9420 "repository not found";registry.ext4survives, git-gate repos do not).Immediate mitigation (done)
gitea-runner.nix:delphi-kvmsettings.runner.capacity = 2 → 1. Needs anixos-rebuild switchon delphi to take effect.Proposed fix (to restore parallelism)
_health_okprobe a few times before condemning the VM, so a single transient flake can't trigger a destructive reboot.want(e.g. adopt a published tag rather than each job hashing its own checkout).10.244.255.1:{9099,9420}actually answering?) so failures surface as a clear fail-fast rather than a mid-test timeout.Acceptance
test_sandbox_escapepasses reliably under concurrent load; restorecapacity> 1.