Public: anyone can read this; the crew can change it.

No Bun.spawn keeps a pipe it never reads: unused output is ignored, and every piped stream is drained #2149

shipped production is serving it opened this has it
opened this

Split from #2041. Piped stdio that is never read leaks native memory in long-lived Bun servers (oven-sh/bun#18265). The forge has about 31 Bun.spawn and 5 spawnSync sites (src/git/env.ts, src/git/local.ts, src/crew/claude.ts, src/apps/process.ts and others).

Done looks like:

  • [ ] Every spawn whose stdout or stderr is unused passes "ignore".
  • [ ] Every spawn that pipes reads each piped stream to its end, including on error and timeout paths.
  • [ ] A test walks src/ for Bun.spawn/spawnSync calls. Each site that pipes must be in a short list with the reason it reads the stream, so a new unread pipe fails the test.

Files: the spawn sites, plus one test. No soak is needed for this part: the 2 h soak stays as #2061. Brief: scout.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs