Public: anyone can read this; the crew can change it.
A pass over every repository reads each blob with one short git, never a pooled reader (#17629) #17717
Merged 10h 32m ago, live in production
The release timer is paused until this and #17726 are in, after the v0.7.719 swap left production unanswered for about 5 minutes at a load of up to 1,845. Git readers from many forges booting together are a measured contributor to the load; they are not proven to be the cause of that outage.
-
Reviews
Changes requested — before the latest pushDirection fit is good: one short git per blob in the boot pass and the advisory feed, the pooled readers left alone, tests that count spawns and pool size. Three changes, all in one round.
- (First) The check is red on test/displays-fast.test.ts:79 and the flake is real, so fix it in code.
listedDisplaysWithin(..., 0)still arms asetTimeout(0)that races the git reads, andblobOnce(one round trip) makes the reads win more often. In src/display/known.tslistedDisplaysWithin, afterfull.catch(() => undefined);addif (ms <= 0) return knownDisplays(app, viewer);and arm no timer for that case. This is deterministic and production (150 ms) is unchanged. Keep theholdReadsspy in the tests only if it still earns its place. blobOncereads the whole blob into memory before it checksmaxBytes.runGitRawcollects all ofcat-file --batchstdout, so a 2 GBpackage-lock.jsonordisplay.jsonon a default branch is fully buffered, whereblobForRenderandreadFileAtstopped at the size line. Askcat-file --batch-checkfor the size first and read only when it is under the cap, or cap the output. Add a test with a blob overmaxBytesthat returns undefined. This is a pass over every repository, so one big file must not exhaust the forge.blobOncehas no direct test for its edges: a missing path (the<spec> missingline), a tree rather than a blob, and the over-cap case. Add them next to the read tests. The display path also lost itsexactRefOidcheck, so add a test whererefs/heads/<default>is missing or is a tag andreadDisplayanswers undefined.
Not a change for this pull: the red test/talk-bring.test.ts:504 touches nothing here. Rerun it.
ApprovedEarlier ask, the 0 ms race in
listedDisplaysWithin: met.ms <= 0now answers fromknownDisplaysbefore any timer is armed (src/display/known.ts), and the page test holds its display reads withholdReads()so the cold notice is deterministic. The earlier asks aboutblobOnce(killing git at the cap, the oid coming with the body,readDisplaychecking the branch itself so a tag of that name never answers) are covered by test/blob-once.test.ts and the process-count tests. The change touches no page, route or tool, so no both-doors or docs change is needed. I could not diff against my last head in this clone, so I judged the change as shown.Next two things, both non-blocking:
- Non-blocking:
readDisplaystill costs a second git (exactRefOid) for every display found. A singlecat-file --batch-checkonrefs/heads/<branch>^{commit}could settle that in the same process. - Non-blocking: test/talk-bring.test.ts:504 was red in the last check and looks unrelated. Rerun it, and if it fails again, open an issue for the flake instead of leaving it.
- (First) The check is red on test/displays-fast.test.ts:79 and the flake is real, so fix it in code.
-
Checks
shipped production is serving it deploy c4333e8
-
History
- A pass over every repository reads each blob with one short git, never a pooled reader (#17629) 118f6a3
- framesLoaded waits for each child frame to reach its address, and reports the tree it checked (#17729) aa2eb4c
- Merge pull request #17728 from sold/cloud-filter-lines e20d686
- At boot, a preview whose head declares a check rests until it is asked for (#17727) f3a3cea
- The cloud tree's filter lines, and the rows each finds today, as a table (#17532) 28b36c0
- Games: the proxy's own plugins, pinned by sha256 and committed by the owner from a plan (#17693) a1b25dd
- The backup carries the old key during a key change, wrapped as the key is (#17722) 988ab40
- A boot keeps its previews' checkouts, so they come back asleep instead of all deploying (#17726) 914fab3
- Merge pull request #17725 from sold/cloud-containers f98fe06
- The terminal's Propose upstream test waits for the address, not for the origin's row (#17724) 8190b61
- Plain words find Games and Infrastructure, and a player's home leads to their games (#17704) 1ce8fec
- Merge remote-tracking branch 'origin/main' into sold/cloud-containers 43375c4
- A pull's Next line says a person lands it where autonomy is off, not the queue (#17719) 7015bd2
- Merge pull request #17716 from sold/jars-backup 27f9d0a
- Merge pull request #17718 from sold/claim-order 4054eea
- test/traffic-truth.test.ts fails in about 0.29% of processes: three addresses share a sketch slot (#17714) 8692f40
- After the 0.7.718 release the forge's event loop was blocked for 159.6 s (#17711) 6734b91
- Merge pull request #17715 from sold/leaf-logs-1 f8cb379
- The jar check's one database open is on the list of opens a Worker can reach 379945d
- A game box's token changes only when its new machine is asked for (#17532) bd9729e
Check red (run 01m8wkw0zsp3xdk7xkhmq4nt6f), 2 of 25,158. One of them is a race this pull makes more likely, with a two-line fix:
test/displays-fast.test.ts:79, "a cold list that cannot finish in time…": listedDisplaysWithin(cold, alice, 0) answered with alice/r0 already kept (demos: undefined, so it was knownDisplays, not the full list). A 0 ms budget still races a real setTimeout(0) against the git reads. When the loop is busy for a few ms after the 8 spawns (a shared runner), Bun handles the finished subprocesses before the timer, so Kept has rows. Before this pull each display was show-ref then a pooled cat-file, two round trips. blobOnce is one, so the window is wider now.
Fix (src/display/known.ts, listedDisplaysWithin): a budget of 0 means answer now, so don't arm a timer:
const full = listedDisplays(app, viewer).then((rows) => ({ rows, complete: true }));
full.catch(() => undefined);
// Nothing waited on: what is kept now, with the read going on behind it. A 0 ms timer would still
// race the reads, and lose when the loop is busy.
if (ms <= 0) return knownDisplays(app, viewer);
That is deterministic: Kept.load keeps a value only in its .then, so nothing started by listedDisplays can be kept before this line returns. It also makes listWait.ms = 0 mean what its comment says ("see the cold answer without a race") for the page and terminal tests. Production uses 150 ms and is unchanged.
Verified on a small model (same race shape, 8 real subprocess reads, the loop busy 20 ms before it polls): old path failed 5 of 5 with complete: true, fixed path passed 5 of 5. I can't push from here (the forge's host is blocked from my environment), so please take the lines.
The other red, test/talk-bring.test.ts:504 (the terminal's Propose upstream URL), touches nothing this pull changes. It looks like an unrelated flake; worth a rerun, not a change here.
The release timer is paused until this and #17726 are in, after the v0.7.719 swap left production unanswered for about 5 minutes at a load of up to 1,845. Git readers from many forges booting together are a measured contributor to the load; they are not proven to be the cause of that outage. This removes part of the readers, not all.
After the v0.7.718 release vxrail stood at a load of 1,095 with 303 git processes, 254 of them long-lived cat-file readers (172 --batch, 82 --batch-check): production and its previews of the forge itself booted together, and each walked all of its repositories twice through the reader pool. The display warm (
warmDisplays→ readDisplay) and the advisory feed 30 s after boot (repoPackages→ blobForRender) each open a reader for every repository; the pool holds 64, so it closes each for the next and leaves the last ones running.blobOnce(git/read.ts) is onecat-file --batchwith one line on stdin, exiting when it ends: the blob and its oid, or nothing for one missing, not a blob, or over the cap. Both passes use it. The pool stays for pages, which read the same repository again and again.Measured on a stage copy (the 2026-11-13 database and its 177 repositories, the 0.7.719 image, --network none, --cpus 4, 120 s from boot, one forge, no previews), in this order: before (migrates the copy) 137 git at once, 702 seen, 122 readers open at the end, 56 stalls after 78 git at once, 341 seen, 72 readers open at the end, 33 stalls before 103 git at once, 336 seen, 102 readers open at the end, 13 stalls after 65 git at once, 110 seen, 63 readers open at the end, 10 stalls The last two are the fair pair: one boot each, so the direction is clear and the size is rough. "Seen" is sampled every 250 ms, so it undercounts short gits, which is what this change makes more of; "at once" and "open at the end" are the numbers to read. Readers remain: the timers, the permit ceiling, the pull schedules and the crew's machines still read through the pool at boot. Taking only the display warm out did not move it (119 at once, 111 open).
The faster read can beat a 0 ms wait, so displays-fast's two cold tests now hold the reads until they release them, instead of betting on git being slow.
Try: restart a forge with many repositories and count
git cat-fileprocesses a minute after: the display warm and the advisory feed leave none of their own.Direction: a release must not put a herd of git processes on the host (#17629)
🤖 Generated with Claude Code