Skip to content

Cover fork readiness lifecycle invariants - #325

Merged
sjmiller609 merged 1 commit into
mainfrom
hypeship/follow-up-fork-readiness
Aug 6, 2026
Merged

Cover fork readiness lifecycle invariants#325
sjmiller609 merged 1 commit into
mainfrom
hypeship/follow-up-fork-readiness

Conversation

@sjmiller609

@sjmiller609 sjmiller609 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • guarantee seed Envoy cleanup on every snapshot-start-page exit and cover process/bootstrap teardown
  • cover the applied-marker gate across each post-fork readiness probe
  • name the five-second fork identity response margin alongside the shared apply timeout

Performance

20 sequential headless Firecracker forks per version (8 vCPU), measuring the fork request through the successful fork-identity response and verifying public CDP returned 200 on every run. The Envoy fixture used a static listener to isolate local process startup/readiness from xDS and network variance.

version fork-to-ready p50 fork-to-ready p95 identity handoff p50 identity handoff p95
before 759635d 293 ms 492 ms 69 ms 96 ms
after #324 (0503e9f) 1,564 ms 1,708 ms 1,340 ms 1,498 ms

All runs passed (20/20 per version). The after p95 leaves 28.3 seconds of headroom in the 30-second API timeout and 23.3 seconds inside the wrapper's 25-second readiness deadline.

But it's OK that this is slower because we are migrating off of envoy and the hot pools avoid hitting this case. Also we have another tier of idle pool which we can start filling with fanout.

Testing

  • cd server && go vet ./...
  • cd server && go test -race $(go list ./... | grep -v /e2e$)
  • cd server && make build
  • git diff --check main...HEAD

Note

Medium Risk
Touches fork handoff timing and when the applied marker is written; incorrect gating could stall or falsely signal fork readiness to the API.

Overview
Tightens fork-identity readiness so the applied marker is only written when every post-fork probe succeeds, and documents the 5s response margin next to ApplyTimeout in forkidentity.

writeForkIdentityAppliedMarker centralizes that gate; readiness polling is split into waitProbesReady so tests can assert per-probe behavior (cdp, chromedriver, envoy) without a full boot.

Snapshot start page seed Envoy teardown is guaranteed on all exit paths via a defer, with cleanupSeedEnvoyWith for unit tests of stop + bootstrap removal.

Reviewed by Cursor Bugbot for commit 688cd10. Bugbot is set up for automated code reviews on this repo. Configure here.

@sjmiller609
sjmiller609 marked this pull request as ready for review August 6, 2026 18:04
@sjmiller609
sjmiller609 requested a review from hiroTamada August 6, 2026 18:09
@sjmiller609
sjmiller609 merged commit 461accb into main Aug 6, 2026
6 of 11 checks passed
@sjmiller609
sjmiller609 deleted the hypeship/follow-up-fork-readiness branch August 6, 2026 18:14
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.

2 participants