Beagle SCM
JS-111: net._accept swallows real accept errors — EMFILE becomes a silent busy-spin
Proposed by the 2026-07-07 jab multi-agent review; confirmed by both skeptic verifiers. All accept failures collapse into "nothing pending", so fd exhaustion turns the level-triggered poll loop into a 100% CPU spin with no error event.
Input
Context
if (TCPAccept(&cfd, caddr, sfd) != OK || cfd < 0) return JSValueMakeNumber(ctx, -1); // no connection ready (jab net.cpp:74-77) — no errno inspection, unlike net.recv/send.
- Server.listen's accept loop treats -1 as backlog-drained and returns pol.IN (net.cpp:309-316); with EMFILE and a pending connection, poll keeps reporting readable, accept keeps failing: spin, no 'error' event, no log.
- Node emits 'error' on the server for non-transient accept failures.
Goals
- errno triage after TCPAccept: -1 only for EAGAIN/EWOULDBLOCK/ECONNABORTED; throw or return a distinct code otherwise, surfaced as a server 'error' event in the bundle.
Constraints
- EMFILE is hard to repro portably in ctest — a unit-level fake or ulimit-based repro is acceptable; ruling needed if neither is workable.
WIP
TODOs