code wiki / _hdl_build / nx_acceptq.nx
nx_acceptq.nx
buildroot/runtime/_hdl_build/nx_acceptq.nx
about
nx_acceptq.nx -- DETECTOR for the ACCEPT-LOOP WEDGE: a daemon that holds its listen socket but has
stopped calling accept().
WHY THIS EXISTS (2026-07-31, measured). The mgmt API blocked in wait4 for the entire life of a forked
build. Connections completed the TCP handshake -- the KERNEL accepts them into the backlog -- so every
port-probe health check reported UP, for six minutes at a time, while no request was served. Three
separate lanes filed it as "MGMT :18098 DOWN, ALL SEATS". :18098 was never down. It was blocked.
★★★ THE INSIGHT THIS ORGAN ENCODES: A SUCCESSFUL CONNECT PROVES THE KERNEL ACCEPTED, NOT THE PROCESS.
The two are indistinguishable from outside -- unless you read the one number the kernel already keeps:
on a LISTEN socket, /proc/net/tcp's rx_queue IS THE COUNT OF COMPLETED-BUT-UNACCEPTED CONNECTIONS.
Non-zero means the app is behind. Sustained non-zero means the app is not accepting at all.
Measured on the live wedge: rx_queue climbed 8 -> 34 while wedged, and returned to 0 once fixed.
This is a pure READER: it opens /proc/net/tcp and nothing else. It cannot perturb the thing it measures,
which matters because the failure it hunts is caused by blocking.
nx_acceptq -> report every LISTEN socket with a non-zero accept backlog
nx_acceptq <port> -> report just that port; exit 1 if it looks wedged
expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 23 | const AQ_CAP: i64 = 1048576 |
functions
| 25 | func aq_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 27 | func aq_putn(v: i64) -> i64 |
| 41 | func aq_hexv(c: u8) -> i64 called by 1: aq_hex |
| 49 | func aq_hex(b: *u8, off: i64, count: i64) -> i64 |
| 61 | func aq_is_sp(c: u8) -> i64 { if c == (32 as u8) { return 1 } if c == (9 as u8) { return 1 } return 0 } called by 1: aq_next |
| 64 | func aq_next(b: *u8, off: i64, n: i64) -> i64 |
| 76 | func aq_scan(want_port: i64) -> i64 |
| 132 | func main(argc: i64, argv: *i64) -> i64 |