code wiki / _hdl_build / nx_pub_recover_exec.nx
nx_pub_recover_exec.nx
buildroot/runtime/_hdl_build/nx_pub_recover_exec.nx
about
nx_pub_recover_exec.nx -- THE PUBLISHER'S RECOVERY EXECUTOR (the action rung after nx_pub_recover's decision).
Consumes PENDING recovery requests from the queue, KILLS the wedged daemon by name (proc_kill_by_name ->
the existing nx_hostctl keeper respawns a FRESH one = the wedge clears), flips the queue line PENDING->DONE
(atomic rewrite under fl_acquire), and appends a recovery LEDGER record. The Publisher owns the recovery
ACTION; hosting's supervisor owns the respawn (its existing job) -> clean separation, no second supervisor,
no touching nx_hostctl. SIGTERM (15) = graceful; never-brick #26 (kill+supervised-respawn is reversible,
no destructive write). Runs on the host where the daemons live (NAS); the gate proves it on a real mock.
pe_exec(queuepath, ledgerpath) -> number of recoveries executed
license_tier: ORIGINAL
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_proc_ctl.nxnx_pub_recover.nx
imported by: nx_pub_recover_exec_gate.nxnx_pub_recover_pulse.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 14 | const PE_MAGIC_100000: i64 = 100000 |
| 15 | const PE_MAGIC_4096: i64 = 4096 |
| 17 | const PE_QUEUE: *u8 = "knowledge/publish/recovery_queue.tsv" |
| 18 | const PE_LEDGER: *u8 = "knowledge/publish/recovery_ledger.tsv" |
| 19 | const PE_LOCK: *u8 = "publish_recover" |
| 20 | const PE_SIGTERM: i64 = 15 |
functions
| 22 | func pe_exec(queuepath: *u8, ledgerpath: *u8) -> i64 called by 3: mainmainpulse_pass calls 13: fl_acquiresys_mmapsys_read_filefl_releasepr_fieldproc_kill_by_name+7 |
| 69 | func pe_uw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 70 | func main(argc: i64, argv: *i64) -> i64 |