You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Node SDK] Bubblewrap detached-anchor test races process exit during /proc scan #1293
The Node SDK unit test reaps the detached anchor after repeated probes can fail while scanning /proc because directZombieChildren() treats ENOENT as an expected process-disappearance race but rethrows ESRCH.
The failure was observed on September 26, 2026 in #1269 at head 96b949518, workflow run 36275024031, job sdk-unit-tests / SDK Unit Tests (linux) (108496011999). The test and Bubblewrap probe source files are byte-identical to the #1256 base, so this is not attributable to the versioning change.
directZombieChildren() enumerates numeric /proc entries and then reads /proc/<pid>/status. A process can exit between enumeration and the read. Node's fs.readFileSync returned ESRCH for that disappearance, while the catch block ignores only ENOENT. The same test file already defines isProcessGoneError, which recognizes both ENOENT and ESRCH, but directZombieChildren() does not use it.
A robust fix is to use isProcessGoneError(err) when reading /proc/<pid>/status, so either representation of a process disappearing during the scan is ignored while unexpected filesystem errors still fail the test.
Steps to reproduce
On Linux, build and repeatedly run the Node platform unit tests under process scheduling load:
cd sdk/node
npm test
Focus on reaps the detached anchor after repeated probes while short-lived probe/anchor processes are exiting.
Observe the race between fs.readdirSync('/proc') and fs.readFileSync('/proc/<pid>/status').
Observed CI evidence:
reaps the detached anchor after repeated probes ... FAILED
Error: ESRCH: no such process, read
at Module.readFileSync (node:fs:483:20)
at directZombieChildren (.../platform.test.js:49:31)
Workflow run: 36275024031
Job: 108496011999
Expected behavior
A process disappearing during /proc enumeration is treated as normal concurrent process lifecycle behavior. The test continues scanning and deterministically validates that no detached anchor zombies remain.
Actual behavior
If /proc/<pid>/status returns ESRCH, the helper rethrows it and fails the entire Linux Node SDK unit job even though the process simply exited during enumeration.
Activity