Skip to content

fix(metrics): fail server startup waits as soon as the server exits - #46978

Merged
juliusmarminge merged 1 commit into
mainfrom
fix/metrics-server-exit
Dec 1, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
fix/metrics-server-exit

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

The server benchmark (scripts/metrics/server/server-metrics.ts) waited up to five minutes for / to answer and then up to five more for server-runtime.json, even after the server process had died. On Windows today, B (6043feb8203) crashed natively about 1 s after it started answering HTTP (0xC0000374 / 0xC0000409). The vp.exe node shim turns that into exit code 9 or 116. Each crash showed up as the rest scenario failed: server never recorded its runtime state:, with only the inspector banner on stderr, after a 5-minute wait. That crash is tracked separately.

Both startup waits now race the child's exit. When the server exits, the run fails immediately and reports the exit code and stderr.

Evidence (cups, run --quick --only rest --checkout <fake> where the fake apps/server/src/bin.ts exits):

  • exits 9 before listening: server exited (code 9) before it answered: after 2 s (before: ~5 min server never answered)
  • answers HTTP, then exits 116 after 1 s: server exited (code 116) before it recorded its runtime state: after 3 s (before: ~5 min server never recorded its runtime state)

vp run check:changed passes.

Opus 5.5 via Claude Code (daily perf audit)

🤖 Generated with Claude Code

The server benchmark waited up to five minutes for HTTP and then for
server-runtime.json even when the server process had already died, and
reported only "never recorded its runtime state" with whatever stderr it had.
Both waits now race the child's exit and fail at once with its exit code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Dec 1, 2026
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

startServer now races its HTTP-readiness and runtime-state waits against the child process exit. If the child exits first, the wait fails with the exit result, startup stage, and captured stderr.

Changes: Startup exit handling

Layer / File(s) Summary
Race startup waits against process exit
scripts/metrics/server/server-metrics.ts
A shared helper races startup waits against the child process exit. The HTTP-readiness and runtime-state waits use it to report exits at their respective startup stages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to f5e5c

The benchmark now fails immediately when the server process exits during startup, instead of waiting for a timeout. The change is limited to a metrics script and carries minimal merge risk. The crash message could occasionally omit the last stderr lines.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: startup waits in the server benchmark now fail as soon as the server process exits. It uses a conventional commit prefix and is one sentence. It matches the raw summar…
Description check Passed The description follows the template's main sections: Problem, Change, Scope, and Verification. The Problem section states the bug (waits continue after the server dies) and gives reproduction context…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: startup waits in the server benchmark now fail as soon as the server process exits. It uses a conventional commit prefix and is one sentence. It matches the raw summary and the objectives.

Full details: Description check

Explanation

The description follows the template's main sections: Problem, Change, Scope, and Verification. The Problem section states the bug (waits continue after the server dies) and gives reproduction context. The Change section explains the race against the child's exit. The Verification section gives specific fake-server runs with observed exit codes, timings, and messages, and it notes that check:changed passes. Scope is weak: it does not link an issue or explain why no issue is needed, and the author notes the native crash is tracked separately. The model and harness line is present. These gaps are non-critical, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c1cb1f6 and f5e5c65.

Files selected for processing: 1

  • scripts/metrics/server/server-metrics.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f5e5c65

Macroscope's review found this PR approvable — The metrics harness now stops waiting when its server exits during startup and reports exit details with captured stderr. The change is limited to benchmark failure handling and retains existing cleanup.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge merged commit 84b81a0 into main Dec 1, 2026
36 checks passed
@juliusmarminge
juliusmarminge deleted the fix/metrics-server-exit branch December 1, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant