Skip to content

Fix ESRCH race in EvalHost teardown, rebind the 9.0.0 seal - #87

Merged
vriesd merged 2 commits into
mainfrom
fix-proc-enumeration-esrch
Sep 15, 2026
Merged

vriesd merged 2 commits into
mainfrom
fix-proc-enumeration-esrch

Conversation

@vriesd

@vriesd vriesd commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Unblocks the 9.0.0 tag. Main CI went red after #86 merged, on eval host writes reviewer model through native plugin tuple options.

Root cause — a real race, not a flake

ESRCH: no such process, read
  at readFile(`/proc/${entry.name}/stat`)   evals/harness.ts:682
  at processGroupMembers                    evals/harness.ts:215
  at signalProcessTreeDescendants           evals/harness.ts:445
  at terminateChildProcessTree              evals/harness.ts:570
  at stopOnce                               evals/harness.ts:2381
  at tests/eval-host-config.test.ts:61      ← the finally { await host?.stop() }

Enumerating a process table is inherently racy: a member can exit between the readdir of /proc and the read of its entry. Linux reports that as ENOENT when the directory is already gone and ESRCH when the process is mid-reap. The catch handled only ENOENT, so ESRCH escaped, rejected the Promise.all, and failed the test that was tearing down.

It failed in 11.5s, far below the 180s/240s timeouts — it errored, it didn't stall.

Signalling at harness.ts:670, :717 and :733 already treats ESRCH as gone. Only the enumeration path missed it, so this restores the file's own convention rather than inventing one.

Linux-only, which is why it passes on macOS locally and only bites in CI. It will recur intermittently until fixed.

Fix

processVanished(error) treats ENOENT and ESRCH alike and is exported so the classification is testable without staging a real /proc race. tests/eval-process-teardown.test.ts pins both codes as gone and EACCES/EIO/absent as real failures that must still surface.

Seal rebound

evals/harness.ts is in the release grader closure, so this fix invalidated the 9.0.0 seal — confirmed by running the verification and watching it refuse:

Qualification bundle qb1-26f58d9f… for 8.3.0 did not regrade cleanly.

Regraded the same original 8.3.0 campaign and canary offline, no model calls. New seal sha256:5583ec12…, record rebound.

The candidate artifact is unchanged. The harness is not in the packed file list, so the tarball still hashes to 2d7539bb… — the same value 9.0.0 was qualified against. This changes the evidence binding, not the thing being released.

Verification

  • bun run check — 1220 pass, 1 skip, 0 fail.
  • bun scripts/release.ts init … --feature evals/qualification/features/9.0.0.jsonRelease record verified.

🤖 Generated with Claude Code

vriesdcrv and others added 2 commits September 15, 2026 06:14
…tion

Reading /proc/<pid>/stat while stopping an EvalHost raced the process exiting.
The catch handled ENOENT but not ESRCH, so the rejection escaped Promise.all and
failed the test that was tearing down. Signalling at lines 670, 717 and 733
already treated ESRCH as gone; only the enumeration path missed it.

Linux-only, which is why it passed on macOS and failed on CI.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The teardown fix touches evals/harness.ts, which the release grader closure
covers, so the previous seal no longer regrades. Same original 8.3.0 campaign
and canary, regraded offline with no model calls. The candidate artifact is
unchanged: the harness is not packed, so the tarball hash held.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vriesd
vriesd merged commit 8a0728a into main Sep 15, 2026
7 checks passed
@vriesd
vriesd deleted the fix-proc-enumeration-esrch branch September 15, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants