mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 16:39:50 +00:00
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>
This commit is contained in:
parent
b279cc7c8b
commit
2907ff6068
7 changed files with 11 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.10.10",
|
||||
"version": "0.10.11",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -1091,8 +1091,8 @@ export async function uploadFile(localPath: string, remotePath: string): Promise
|
|||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"ignore",
|
||||
"pipe",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1053,8 +1053,8 @@ export async function uploadFile(localPath: string, remotePath: string, ip?: str
|
|||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"ignore",
|
||||
"pipe",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -325,8 +325,8 @@ export async function ensureFlyCli(): Promise<void> {
|
|||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"ignore",
|
||||
"pipe",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ export async function ensureGcloudCli(): Promise<void> {
|
|||
stdio: [
|
||||
"ignore",
|
||||
"inherit",
|
||||
"pipe",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -619,8 +619,8 @@ export async function uploadFile(localPath: string, remotePath: string, ip?: str
|
|||
{
|
||||
stdio: [
|
||||
"ignore",
|
||||
"ignore",
|
||||
"pipe",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ export async function ensureSpriteCli(): Promise<void> {
|
|||
stdio: [
|
||||
"ignore",
|
||||
"inherit",
|
||||
"pipe",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue