Skip to content

fix(core): ignore late EPIPE from hook stdin - #360

Merged
filipeforattini merged 2 commits into
mainfrom
hook-stdin-epipe
Sep 23, 2026
Merged

filipeforattini merged 2 commits into
mainfrom
hook-stdin-epipe

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Sep 22, 2026 •

Copy link
Copy Markdown

Problem

HookV2 tests fail intermittently under parallel CI with an uncaught EPIPE: broken pipe, write. The handlers in those tests (like many real hooks) exit without reading stdin.

Cause

AppProcess.run passes the hook input as stdin; Effect's NodeChildProcessSpawner writes it through a sink that listens for errors only while attached. When the child exits first, the pipe closes and the pending write fails with EPIPE after the sink stopped listening, so it escapes as an uncaught error: the running test fails, and in production the error surfaces from a hook that simply ignored its input.

Fix

Patch @effect/platform-node-shared@4.0.0-beta.83 to attach a no-op error listener on the child's stdin before wiring the sink. The sink still reports errors while it is attached; only a late one is kept from escaping.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@filipeforattini
filipeforattini enabled auto-merge (squash) September 22, 2026 23:48
@filipeforattini
filipeforattini merged commit d49bf6d into main Sep 23, 2026
23 checks passed
@filipeforattini
filipeforattini deleted the hook-stdin-epipe branch September 23, 2026 01:02
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.

1 participant