spawn/packages/cli/src/fly
A 2907ff6068
fix: drain piped stderr in CLI installers and uploadFile to prevent deadlock (#1922)
PR #1920 fixed pipe buffer deadlock in runServerCapture and
waitForCloudInit but missed 6 other locations where Bun.spawn uses
"pipe" for stderr without draining it before await proc.exited.

When a child process writes >64KB to a piped stderr, the OS pipe
buffer fills, the child blocks on write(), and the parent blocks on
exited — classic deadlock.

Fix: change stderr from "pipe" to "inherit" in all 6 locations since
the stderr output is never read programmatically. This also lets
users see installation errors and SCP errors in real time.

Affected functions:
- fly.ts ensureFlyCli()
- sprite.ts ensureSpriteCli()
- gcp.ts ensureGcloudCli()
- hetzner.ts uploadFile()
- digitalocean.ts uploadFile()
- aws.ts uploadFile()

-- refactor/code-health

Agent: code-health

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-25 09:26:27 -05:00
..
agents.ts fix: use npm install for OpenClaw to fix Node module resolution (#1878) 2026-02-24 04:51:09 -05:00
fly.ts fix: drain piped stderr in CLI installers and uploadFile to prevent deadlock (#1922) 2026-02-25 09:26:27 -05:00
main.ts feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00