Skip to content

fix(core): include worker stderr in unexpected-exit summary#956

Merged
9aoy merged 1 commit intomainfrom
max/2026-02-09--08-23PM
Feb 10, 2026
Merged

fix(core): include worker stderr in unexpected-exit summary#956
9aoy merged 1 commit intomainfrom
max/2026-02-09--08-23PM

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Feb 9, 2026

Summary

supersede #949.

This PR fixes missing diagnostics when a child worker crashes (for example, rspack panic) under tinypool child_process mode. It captures worker stderr at the pool layer, binds output to the active task via worker meta messages, and appends relevant logs to the summary error. The implementation avoids renderer/global stderr monkey-patching and adds e2e coverage for the crash path.

Behavior diff:

+------------------------+------------------------------------------+--------------------------------------------------+
| Area                   | Before                                   | After                                            |
+------------------------+------------------------------------------+--------------------------------------------------+
| Worker crash summary   | only "Worker exited unexpectedly"        | includes "Maybe related stderr" with crash logs |
| Stderr attribution     | no task-scoped stderr binding            | task->pid binding via structured worker meta     |
| Regression coverage    | no panic-specific e2e assertion          | panic fixture + summary assertions added         |
+------------------------+------------------------------------------+--------------------------------------------------+

Changes:

  • pool-level stderr capture module
    • new packages/core/src/pool/stderrCapture.ts with ring buffer, truncation, close-wait timeout
  • structured worker meta channel
    • new packages/core/src/pool/workerMeta.ts; worker emits meta in packages/core/src/runtime/worker/index.ts
  • forks pool error enrichment
    • packages/core/src/pool/forks.ts parses worker meta and appends captured stderr on unexpected worker exit
  • e2e crash-path validation
    • new e2e/worker/fixtures/worker.panic.test.ts and assertions in e2e/worker/index.test.ts

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c81424e36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fi3ework fi3ework force-pushed the max/2026-02-09--08-23PM branch from 3c81424 to ed571e1 Compare February 9, 2026 12:58
@fi3ework fi3ework requested a review from 9aoy February 9, 2026 14:20
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 10, 2026

📝 Rstest Ecosystem CI: Open

suite result
rslib ✅ success
modernjs ✅ success
rsbuild ✅ success
rspress ✅ success
rsdoctor ✅ success

@9aoy 9aoy merged commit a921d3d into main Feb 10, 2026
9 checks passed
@9aoy 9aoy deleted the max/2026-02-09--08-23PM branch February 10, 2026 03:38
@9aoy 9aoy mentioned this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants