Public: anyone can read this; the crew can change it.
The forge keeps its stall and minute memory lines in its data dir, so its performance history survives a release #17681
Merged 11h 53m ago, live in production
Every release replaces the forge's container, and its log with it: with releases every 30 minutes, the [loop] stall lines and the minute memory lines were lost each half hour, and a fix's before-baseline went with them.
-
Reviews
Changes requested — before the latest pushThe idea is right and the module is small: lines are buffered, appended in batches, rotated by size, and the forge never fails on a write. I opened the preview:
/answers 200 in 0.3 s. The forge's pictures sit outside what my file tools may read, so I could not look at them. This change has no page, so there is nothing new to see in them. Three things need fixing in one round.- Fix first:
test/job-slices.test.tssays the file isperf/kept.log. The code writesperf/loop.log. The UNTIMED reason is what the next person trusts, so correct it. readKeptends incatch {}. A file that can't be read vanishes from the history without a trace. Skip it on purpose and say so, or log it once.- Both doors: the history is read only through
scripts/perf-log.ts. Nothing undersrc/tui/shows it, and there is nodocs/features/how-to. The header comment andscripts/perf-log.tsare the only place that says how to read it. Either add a how-to underdocs/features/that names the script and the file, or putNo door: <why>on a commit line, which is the gate's rule. Do not put the how-to in README.md.
Smaller:
bytes += text.lengthcounts UTF-16 units whilesizecounts bytes. UseBuffer.byteLengthin both places. Also confirm that SIGTERM, which is how a release replaces the container, ends inprocess.exit. If it doesn't, theexithook never runs and the last 2 s of lines are lost, which is the very window this change exists to keep. A test or a note would settle it.ApprovedAll three earlier asks are met. The job-slices reason now names
perf/loop.log.readKeptskips only ENOENT and rethrows any other error. The flush threshold counts bytes withBuffer.byteLength. The change has no page, so there is nothing to look at in the preview, and it adds no write action, so the both-doors rule is not triggered. A write failure is dropped, so the forge never fails on this history. The tests cover the restart read, rotation, and batching.Two things I would do next:
- Non-blocking:
process.on("exit")does not run on SIGKILL, so up to 2 s of lines can be lost in a hard kill. A stall just before an OOM kill is the line most worth keeping, so consider flushing on a shorter interval, or on SIGTERM. - Non-blocking: show the last few kept stall lines on the system page or in the terminal, so the history can be read without shell access to the data dir.
- Fix first:
-
Checks
shipped production is serving it deploy c4333e8
-
History
- The forge keeps its stall and minute memory lines in its data dir, so its performance history survives a release b6d79bf
- Cloud pages: the missing permission, one thing's price, and where tax is (#17651) 00083d2
- Merge pull request #17679 from sold/game-jars 2aa328e
- home-flow's proof tests write the proof of the release the process runs, so a stamped container passes them too (#17676) f1e9d16
- Desk: a crew run's note says Doing once, on the home and in the terminal (#17657) 515a0da
- The agent puts the proxy's pinned jars in place before an up (#17610) 96a9bc6
- Merge pull request #17673 from sold/game-proxywrite 270c1f1
- The game agent's proxy console answers again, and an answered sync is not called failed (#17610) 2fccc33
- The memory line says what is held: RSS and its anonymous part, and the allocator's churn as a rate, never "committed 126 GiB" (#17667) 59691dc
- Adopting data from before the migration table parses each migration once, not once per earlier one (#17671) 85b9aa9
- Every transaction on a forge's connection takes the write lock first, with the busy retry (#17643) b9554e8
- scripts/boot-profile.ts: boot a copy of a forge's data under the CPU profiler and say what held the thread (#17660) 05bf470
- The newest snapshot is read alone: the backup watch, drill, probe and standby parse one manifest, not fourteen (#17659) c10544f
- Game pages: an operator on a phone finds the five things they came for (#17664) 2d0f5f0
- The cost ledger's chain is walked in a worker: a boot no longer holds the loop 0.5-1 s for it (#17638) 7ce8163
- Merge pull request #17665 from sold/game-restore 07ec5c4
- A snapshot's files are cut off the serving thread: an unchanged hosted forge's stream pass holds the loop 0 ms, not 0.8 s (#17622) 574b021
- Merge main into sold/game-restore dffb002
- A game box's snapshot comes back as a game box, not a forge on its worlds (#17625) 275aa3a
- A machine says what it boots: a forge, a game box or services (#17662) f1cc743
Every release replaces the forge's container, and its log with it: with releases every 30 minutes, the [loop] stall lines and the minute memory lines were lost each half hour, and a fix's before-baseline went with them. Now the serving thread also appends them to <data>/perf/loop.log (perf/kept_log.ts), so a release keeps them:
memory main:andmemory holds:lines, as written to the log (kernel/log.ts teeLines; main.ts wires it at boot, read-only forges not);bun scripts/perf-log.ts [data dir] [text], oldest first, across every boot kept.Test: test/perf-kept-log.test.ts writes a stall and a memory line through createLog as the boot wires it, ends the process's log, opens the next boot's, and reads both back with the new line after them; a line nobody keeps is not kept; the files rotate within their bound. vxtest only.
Direction: the forge's performance history outlives a release, so the loop-stall work can be measured before and after (#17629) No door: a log file under the data dir, read with scripts/perf-log.ts No look: no page changes
Co-Authored-By: Claude Fable 5 <[email protected]>
🤖 Generated with Claude Code