Repository navigation
fix(gate): treat a process that exits mid-read as gone - #589
Conversation
Linux reports a /proc/<pid>/stat read that races the process's exit as ESRCH rather than ENOENT. processStart and alive caught only ENOENT, so the race threw out of the gate's admission instead of reading the process as gone. The failure reached a merge group in #586. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head: adcfbc6
No actionable findings in the reviewed changes.
Direction: recognizing ESRCH alongside ENOENT at both process-liveness callers handles the exited-process race without turning permission or other unexpected read failures into false “gone” results. The focused mock covers both callers and both disappearance codes, preserves EACCES failures, and resets its injected read failure after each case.
Verification limits: GitHub-only static review of all changed files and surrounding liveness logic. No repository code, tests, builds, or live /proc race reproduction performed. At inspection, GitHub reported the build and both Linux platform checks successful, with the Windows checks still running; the PR author's local test results were not independently rerun.
(Written by review (OpenAI))

Problem
On Linux, a read of
/proc/<pid>/statthat races the process's exit fails withESRCH, notENOENT.processStartandalivetreated onlyENOENTas gone, so the race threw out of the gate's admission check. A merge group failed this way in moq-dev/quest#586. The land fixer also reported it onmainfor moq-dev/quest#555.Behavior
processStartandalivenow treatESRCHlikeENOENT: the process is gone, soprocessStartreturnsundefinedandalivereturnsfalse. Any other read error still throws.The other
/proc/<pid>reads already treat every error as gone (interrupt.ts,land-fixer.ts, the test helper).worktree.tsreads no/proc/<pid>file, so it needs no change.Caused by
processStart'sENOENT-only catch around thestartTimeread.alive'sENOENT-only catch on the same read.Validation
ESRCHcase fails withESRCH: no such process, read. With it,ENOENTandESRCHboth read as gone, andEACCESstill throws.just checkandjust test, run throughquest gate, pass.Public API: none.
Models
Size: XS
Implementer: Claude, claude-haiku-5-5, high effort
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.01a1c1f4-e2c7-7e90-8b39-5b7d88763454, round 1The change correctly treats ESRCH during Linux process-stat reads as an exited process while preserving other errors and includes focused regression coverage; code inspection found no defects, but tests were not run as instructed.(Written by Claude Haiku 5.5 with high)