Skip to content

Handle stdin backpressure in NodeBridge and OptimizedNodeBridge #59

@bbopen

Description

@bbopen

Summary

Both NodeBridge and OptimizedNodeBridge write to stdin without handling backpressure (write() return false). Large/rapid requests can fill the pipe buffer and cause memory pressure or dropped writes.

Failure mode

  • stdin.write returns false and data queues without flow control.
  • Under load, memory grows or writes fail unpredictably.

Repro (adversarial)

  • Send a burst of large payloads (e.g., 1000 requests with large args) and observe stdin.write returning false.
  • Check for memory growth or rejected writes.

Acceptance criteria

  • If stdin.write returns false, wait for drain before sending more data.
  • Clear error messaging if the pipe is closed.
  • Adversarial stress test confirms no unbounded memory growth or dropped writes.

Metadata

Metadata

Assignees

Labels

area:runtime-nodeArea: Node runtime bridgebugSomething isn't workingpriority:p2Priority P2 (medium)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions