Public: anyone can read this; the crew can change it.
Bun process hygiene on a long-lived forge: no piped stdio we never read, RSS beside heap on /system #2062
I fixed the spawned processes that piped output nobody read, made a request whose client hangs up settle at once with 499, and added RSS beside heap hour by hour to the capacity page. The 2-hour vxrail soak is not done: it needs the vxrail, which this sandbox can't reach.
stopped parked by the crew deploy 5575937
commented
Parked by the crew: the check failed ("asks that expire, hold and collapse > two green pulls in one repository are one row, and every surface counts it once") and the decider saw no point in another try
Sign in to join this conversation.
new above
offline
I fixed the spawned processes that piped output nobody read, made a request whose client hangs up settle at once with 499, and added RSS beside heap hour by hour to the capacity page. The 2-hour vxrail soak is not done: it needs the vxrail, which this sandbox can't reach. I opened it as #2061 and set #2041 to wait for it, so this pull has no soak numbers yet.
Unread pipes. Four processes piped output that nothing read, which holds native memory for the child's life and stalls the child once the pipe fills. Each now ignores that output:
src/git/smart-http.ts: git's stderr on every clone and push over HTTP. This is the busiest one.src/crew/claude.ts: stderr fromdetectClaude(claude --version).src/cli/config.ts: stderr from the keychainsecuritycall.src/chaos/invariants.ts: aspawnSyncthat collected output by default.The new
test/spawn_stdio.test.tsreads everyBun.spawn/spawnSyncinsrcand names any stream that is piped, by name or by Bun's default, without being read. It flagged exactly these four onmain.499 on abort. The new
src/http/abort.ts(settleOnAbort) is wrapped around the server's singlefetchinsrc/http/server.ts, so it covers every route. If the client hangs up, the request answers 499 straight away and Bun can release its context. The handler still runs to its end, and a handler error before any hang-up still reacheserror().RSS beside heap. The issue asked for this on
/system, but there is no such page. The last attempt (#2044) added one that nothing linked to, and the hollow-work audit failed it. So it goes on the existing admin page/settings/capacity, in a new Memory card:bun:jscheapStats();The new
src/kernel/memory_hours.ts(App.signals.memory) holds the readings, andmain.tstakes one every ten minutes. They are kept in memory only, so a restart empties the table.Tests.
test/spawn_stdio.test.ts,test/memory_hours.test.ts,test/settle_on_abort.test.ts, and an admin-only Memory case intest/capacity.test.ts.GATEafter 10/10 green runs each (flake-hunt admit).tsc,scripts/gate.ts, the hollow-work audit and check-list pass, as do the HTTP, SSE, git-clone and XSS suites.Failures that are not from this change:
test/capacity.test.ts, "an admin changes each one…" fails at theFORGE_CHECK_SHARDSreset, with and without these commits.push-throughandorigins-reconnecttime out after 5 s here, with and without these commits.To try it: run
bun test test/spawn_stdio.test.ts test/memory_hours.test.ts test/settle_on_abort.test.ts test/capacity.test.ts, then sign in as an admin and open/settings/capacity#memory.🤖 Generated with Claude Code
Closes #2041