nx_daemon_reap_gate.nx
buildroot/runtime/nx_daemon_reap_gate.nx
about
nx_daemon_reap_gate.nx -- referee for nx_daemon_reap_lib, the ONE child reaper every forking daemon
in the estate should compose.
It gates the SAME functions a daemon would run, not a reimplementation, and it reaps REAL children it
forks itself -- a reaper proven only on synthetic inputs has never met wait4.
THE TEETH THAT MATTER:
T1 is the empty-set case, and it is not decoration: a drain called with no children must RETURN, not
block. Getting WNOHANG wrong turns every idle accept loop in the estate into a hang.
T3 proves reaping actually happens against children this gate created, so a pass cannot come from a
function that quietly does nothing -- the exact vacuity that let sixteen daemons leak for weeks.
T6/T7 are the counter-underflow guard. A live-child counter that goes NEGATIVE turns a concurrency
cap into a permanent grant, and that failure direction is silent: the daemon keeps serving, keeps
forking, and nothing looks wrong until the box is the thing that reports it.
T5 neg-control: below the cap the throttle must NOT wait. A throttle that always blocks would pass
every "did it reap?" tooth while serialising the whole server.
T8 bite: the drain FIRES on an exited child and stays SILENT when there is none, in one cell.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_gate_verdict.nxnx_daemon_reap_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 26 | const DRG_SPIN_MAX: i64 = 1000000 |
| 27 | const DRG_KIDS: i64 = 3 |
| 31 | const DRG_ALIVE_MS: i64 = 300 |
functions
| 33 | func main(argc: i64, argv: *i64) -> i64 |