#1198 (yetihan) moved 15 packages' liveness checks onto scripts/proc.mjs,
so a Linux zombie no longer holds a lock. Two were left on a bare
kill(pid, 0), which answers for a zombie as for a live process:
- deepzora's bridge lock (bridge.mjs lock(), the same code as
reasonix-desktop's, which #1198 fixed): a zombie owner left "Another
bridge operation is running" until the zombie was reaped.
- gumloop's ledger lock peers (gumloop.mjs isAlive): a zombie peer was
counted live, so its ticket was waited on.
Both now import a synced proc.mjs (scripts/sync-proc.mjs lists 17
copies; both package.json files ship it). gumloop's crash-window test
writes its instrumented copy into a temp dir, so proc.mjs is copied
beside it. A new guard in scripts/proc.test.mjs fails when any package
file outside tests and proc.mjs calls kill(pid, 0).
deepzora 0.2.1, gumloop 0.1.2.
Run (mote, HOME=$(mktemp -d)):
- bun test scripts/proc.test.mjs packages/deepzora packages/gumloop:
111 pass, 0 fail. node --test scripts/proc.test.mjs: 9 pass.
- deepzora node --test deepzora.test.mjs: 13 pass.
- node scripts/sync-proc.mjs --check: ok. bun scripts/check.mjs: ok.
Broken by hand: main's bridge.mjs and gumloop.mjs with the new tests:
the guard names both files, and the copies test fails on deepzora.
Not tried: a real zombie owner for these two (#1198's fork-based
zombie check covers proc.mjs itself); a real Gumloop or DeepZora
account. gumloop under node --test fails 3 of 3 on bun:test imports,
the same on origin/main.
yetihan (#1198): a lock whose owner is a Linux zombie was held for
good. process.kill(pid, 0) succeeds on a zombie, so 15 packages' lock
and liveness checks counted an exited, unreaped owner as alive.
- scripts/proc.mjs: processStatus(pid) is dead on ESRCH, and on Linux
also when /proc/<pid>/stat says Z or X; EPERM is "permission", any
other error "unknown". processAlive / processExists keep each
caller's old EPERM and unknown-error meaning.
- scripts/sync-proc.mjs copies it into each package (--check in the
tests); every package's own check keeps its old semantics, now with
zombies dead. agent-console's daemon bundle and window-warmup's dist
are rebuilt.
- 15 packages bumped.
Review run at 28ef6622 (mote, HOME=$(mktemp -d)):
- node scripts/sync-proc.mjs --check: ok.
- bun test (whole repo): 8934 pass, 0 fail.
- bun scripts/check.mjs: every package ok.
- window-warmup's build reproduces its dist/plugin.js byte for byte.
agent-console's bundle diff read line by line: the proc module plus
esbuild's renumbered imports, nothing else (esbuild isn't installed
on mote, so it wasn't rebuilt there).
- Real zombie on Linux (WSL, magpie-desktop): a bash child left
unreaped by an exec'd sleep, /proc stat "Z": the old kill(0) check
says alive, processStatus says dead; the running process says alive.
Not tried: each package's lock contention end to end.