-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgebugSomething isn't workingSomething isn't workingpriority:p2Priority P2 (medium)Priority P2 (medium)
Milestone
Description
Summary
NodeBridge and OptimizedNodeBridge attach error handlers to the child process but not to stdin, stdout, or stderr streams. Stream errors (e.g., EPIPE on stdin) can emit error events and crash the Node process when unhandled.
Failure mode
- Python process exits unexpectedly while JS is writing to stdin.
child.stdinemitserror(EPIPE).- No listener exists → unhandled
errorevent crashes Node.
Evidence
src/runtime/node.tsonly listens tochild.on('error')andchild.on('exit').src/runtime/optimized-node.tslikewise only listens tochildProcessevents.
Proposed fix
- Add
errorhandlers onchild.stdin,child.stdout, andchild.stderr. - Treat these as protocol errors (reject pending, remove/kill worker).
Acceptance criteria
- Stream errors do not crash the Node process.
- Pending requests are rejected with
BridgeProtocolErroron stdio stream errors. - Add a regression test that simulates an
EPIPEon stdin.
Metadata
Metadata
Assignees
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgebugSomething isn't workingSomething isn't workingpriority:p2Priority P2 (medium)Priority P2 (medium)