Skip to content

fix(persona): a reseat pass must not re-open every citizen's stream — the fd leak that darkened the M5 - #3969

Merged
joelteply merged 3 commits into
canaryfrom
fix/a-reseat-pass-must-not-reopen-every-citizens-stream
Sep 12, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fix/a-reseat-pass-must-not-reopen-every-citizens-stream

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Measured 2026-09-12 00:57–01:13Z on 48fbbfd, sixteen minutes after boot: the core
held 19,866 open descriptors, 19,589 of them unix sockets to the airc daemon (which
itself held 23). Every spawn then failed with EBADF and every reader saw a different
symptom — the serving lane's --list-devices probe "could not run", the backend
receipt fell back to CPU, the Metal lane came up on CPU and #3759's gate refused it
every 5 s (zero lanes), web/fetch could not start Chrome. The board read busy; the
node was dead.

The chain: seat_announced_rounds joined every resident into every announced child
round on every 10 s pass ("a join is idempotent on the daemon") and, for finished
children, parted them again — each join/part bumps her membership epoch; every bump
re-opens the command pump's daemon stream (1,961 command_pump.reopened, all
MembershipChanged, attempt 0); the old stream's per-channel sockets stayed open.
Recipe-spawned rounds the tracker does not own are exactly the "not local" children
that re-joined forever.

Three fixes, three layers:

  • the reseat pass reads standing FIRST and joins or parts only on a real membership
    change (per resident, by the child's room id; its already counter now counts);
  • the command pump ignores an epoch bump whose room set did not change
    (persona.command_pump.membership_unchanged) — idempotent joins anywhere in the
    substrate can no longer re-open streams;
  • a process fd gauge (system_resources/fd_gauge.rs) on the memory tick:
    process.open_fds every tick, process.open_fds.high past half the soft limit —
    this class is named before the node goes dark, never after.

Still owed to airc-lib: the per-channel attach tasks must release their sockets when
the stream drops (the guard aborts them; the sockets stayed), and the SDK must handle
AttachCursorAdvanced instead of logging it 6,391 times a minute.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 2 commits September 11, 2026 21:36
… the fd leak that darkened the M5

Measured 2026-09-12 00:57–01:13Z on 48fbbfd, sixteen minutes after boot: the core
held 19,866 open descriptors, 19,589 of them unix sockets to the airc daemon (which
itself held 23). Every spawn then failed with EBADF and every reader saw a different
symptom — the serving lane's `--list-devices` probe "could not run", the backend
receipt fell back to CPU, the Metal lane came up on CPU and #3759's gate refused it
every 5 s (zero lanes), `web/fetch` could not start Chrome. The board read busy; the
node was dead.

The chain: `seat_announced_rounds` joined every resident into every announced child
round on every 10 s pass ("a join is idempotent on the daemon") and, for finished
children, parted them again — each join/part bumps her membership epoch; every bump
re-opens the command pump's daemon stream (1,961 `command_pump.reopened`, all
MembershipChanged, attempt 0); the old stream's per-channel sockets stayed open.
Recipe-spawned rounds the tracker does not own are exactly the "not local" children
that re-joined forever.

Three fixes, three layers:
- the reseat pass reads standing FIRST and joins or parts only on a real membership
  change (per resident, by the child's room id; its `already` counter now counts);
- the command pump ignores an epoch bump whose room set did not change
  (`persona.command_pump.membership_unchanged`) — idempotent joins anywhere in the
  substrate can no longer re-open streams;
- a process fd gauge (`system_resources/fd_gauge.rs`) on the memory tick:
  `process.open_fds` every tick, `process.open_fds.high` past half the soft limit —
  this class is named before the node goes dark, never after.

Still owed to airc-lib: the per-channel attach tasks must release their sockets when
the stream drops (the guard aborts them; the sockets stayed), and the SDK must handle
AttachCursorAdvanced instead of logging it 6,391 times a minute.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ded the membership it was deciding

On 749d91c the first cut oscillated: standing is read through a member's
subscription, so after every resident left a finished round nobody could read
'archived'; the next pass joined all five to find out, read it, parted all five —
733 seats and 256 departures of one room in sixteen minutes, each a membership
epoch bump and a stream re-open (1,721 on the hotfix build). A child seen archived
is remembered for the life of the process; a reboot re-learns it once.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fix/a-reseat-pass-must-not-reopen-every-citizens-stream branch from 58ab414 to 75e3051 Compare September 12, 2026 02:36
…usted provider is not a retry

2026-09-12 02:42:29Z: the first hosting attempt drew all twelve on-disk identities (five
allowed by the hold, seven held out) and then failed because the airc daemon was mid-
restart. The provider is built once at boot and every attempt draws from it, so the
next 700 attempts read "identity provider exhausted at slot 0 — provider yielded 0
intents, planner requires 5" from a directory holding twelve citizens, and the node
sat with zero residents on a healthy lane for half an hour.

ResumeOrMintProvider::rewind() restarts the cursor; the hosting reconciler calls it
before every attempt after the first (nothing was hosted, so nothing double-draws) and
says so (`persona.host.provider_rewound`). Test beside the provider's own.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: L and removed size: M labels Sep 12, 2026
@joelteply
joelteply merged commit 7301dd8 into canary Sep 12, 2026
5 checks passed
@joelteply
joelteply deleted the fix/a-reseat-pass-must-not-reopen-every-citizens-stream branch September 12, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant