code wiki / (root) / nx_hotlisten_gate.nx

nx_hotlisten_gate.nx

buildroot/runtime/nx_hotlisten_gate.nx

3722 B69 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_hotlisten_gate.nx -- R5 proof: SO_REUSEPORT is what makes a ZERO-DOWNTIME handoff possible. license_tier: ORIGINAL THE CLASS UNDER TEST: today every /api/deploy and /api/restart drops the in-flight request (FETCH-FAIL, ~10x in one session) because the daemon is KILLED while answering, and we wrote DOCTRINE around that ("503 = EXPECTED, do NOT retry-hammer") -- a doctrine patch over a missing mechanism. A second process cannot take the port until the first is gone, so there is always a gap. SO_REUSEPORT removes the gap. T1 is the NON-VACUITY CONTROL and it is the whole point: it proves the SECOND bind genuinely FAILS on the standard listener. Without T1, T2 succeeding would prove nothing -- it could just mean the port was free. A cure with no proven disease is not a proof.

dependencies 2 imports · 0 importers

nx_http_server.nx nx_gate.nx nx_hotlisten_gate.nx

imports: nx_http_server.nxnx_gate.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gw sys_write nx_http_server_addr_loopba nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen gn sys_write ↻ sys_mmap ↻ nx_http_server_listen_hot sys_ignore_sigpipe ↻ sys_socket ↻ sys_mmap ↻ sys_setsockopt ↻ sys_bind ↻ sys_close ↻ sys_listen ↻

structs

none

consts

13const HL_PORT_A: i64 = 19731 // control: standard listener, second bind must FAIL
14const HL_PORT_B: i64 = 19732 // cure: hot listener, second bind must SUCCEED

functions

16func main() -> i64