tick: hold a due spawn while it would take the host under its memory floor #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "spawn-memory-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
timeline-lax (7.9 GB) dipped under its 3.5 GB MemAvailable backstop at 04:05Z 10-20 while timeline seats started on top of mrd's resident swing.
Change: before each spawn the tick asks
memgate: MemAvailable must stay ≥spawnFloorMBafter reservingseatMBfor this seat and for each seat already fired that tick. A held key writes no ledger row, so it stays due and fires on a later tick (catch_up: oncejobs keep their latest slot; items stay due 6 h; acatch_up: skipjob is dropped after its 2 min grace). The tick logsdeferred <kind> <slug>: <why>,state.jsoncarriesdeferred_since, and both boards show "spawns held for memory since …" / 「内存不足,自 … 起推迟启动」 while it is set.Module defaults:
spawnFloorMB = 3500,seatMB = 500. The binary's default floor is 0, which turns the gate off.Tests:
memgate(arithmetic, off/unreadable, meminfo parse), engineTestAdmitDefersUntilAdmitted(no ledger row on hold, Admit sees the tick's fired count, the held key fires once admitted), and the board line inTestRenderFlagsAndEscapes.go vet ./...is clean,go test ./...gives 42 PASS and 0 FAIL, andnix build .#timelinebuilds (vendorHash unchanged).Deploy: merge, bump the agent-timeline input in osfiles, then leader-osfiles switches timeline-lax. The defaults need no osfiles config change.
Evidence: sessions card
year=2026/month=10/06-20-tooling-dev/tasks/timeline-lax-item-seats-memory-bound.md§ Findings.