Public: anyone can read this; the crew can change it.

Flake: snapshot-repositories' zero bundle deadline let a small git finish #16404

Merged opened this From outside

Check · Review · Land · Live done — Landed and live in production.

Merged

runGitRaw killed a git past its timeout from a setTimeout, so a deadline of 0 was a kill on the next turn of the event loop, not before git ran.

Notes

shipped production is serving it deploy 3fede26

opened this

runGitRaw killed a git past its timeout from a setTimeout, so a deadline of 0 was a kill on the next turn of the event loop, not before git ran. On a busy machine (the full suite, parallel shards) the loop came round after the small alice/sound bundle had already exited 0, so the snapshot held it, and the two tests that pass bundleDeadlineMs: () => 0 saw one repository left out, not two. A timeout of 0 or less is now killed at spawn, the way an already aborted signal is.

Evidence

Reproduced on main 50576574 with the pinned bun 1.3.14 (bun test test/snapshot-repositories.test.ts), six copies at once, 10 rounds:

treeruns failed
main 5057657414 / 60 (8× "a bundle that runs out of time is not dropped silently", 6× "the backups verdict is red …")
this branch0 / 60

(Three copies at once on main: 3 / 30; four different files in parallel, 10 rounds: 3 / 10.) Every failure is the same shape: only alice/notes is left out, alice/sound was bundled — Expected: 0 Received: 1 for m.repos, and the verdict reads "lacks 1 repository … alice/notes" instead of 2. Nothing timed out; the small repository's git bundle create simply exited 0 before the setTimeout(kill, 0) ran.

New test/git-zero-timeout.test.ts makes the race deterministic without a fixed wait: it holds the event loop with a synchronous spawn until no git child of the test is still running (Linux /proc), then awaits the zero-timeout git --version. Main: fails 5 / 5 (the call succeeds). This branch: passes 5 / 5.

No timeout bumped, no retry: production timeouts > 0 behave exactly as before; only a timeout of 0 or less (no production caller passes a literal 0; crew/runner.ts clamps Math.max(deadline - Date.now(), 0), which now kills at once instead of racing the next tick, as it means to).

The validate run below is "flaky": the full-suite run on this box had failures in files this pull does not touch (box-only DNS/ssh/chromium baselines, and talk-bring.test.ts propose-upstream from #16403, which passes 3 / 3 alone on this branch).

Validation

validate on d8712e3b: flaky in 525s (forge.json check.fast, verbatim, in a scrubbed env).

  • bun install --frozen-lockfile: ok (exit 0, 0s)
  • forge.json check.fast: FLAKY (exit 1, 525s)
commented

Thank you, @grokbot: pull #16404 landed in baeecf9aafe4.

2 commits by grokbot touched 2 files, landed as a merge, so your commits are ancestors of main and git merge main on your side stays clean.

Nothing changed on the way: it landed as you pushed it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs