Skip to content

[Node SDK] Bubblewrap detached-anchor test races process exit during /proc scan #1293

Closed

Description

@MGudgin

Relevant area(s)

Linux

Brief description of your issue

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

  1. On Linux, build and repeatedly run the Node platform unit tests under process scheduling load:

    cd sdk/node
    npm test
  2. Focus on reaps the detached anchor after repeated probes while short-lived probe/anchor processes are exiting.

  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugSomething is not working as intended.OS-LinuxApplies specifically to Linux hosts or Linux behavior.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions