Skip to content

Commit b3ce952

Browse files
committed
fix: use Effect.ignore instead of Effect.asVoid in killDirectChild to prevent SIGKILL phase short-circuit
Effect.asVoid only discards the success value but does not suppress errors. When child.kill fails (e.g., child already exited), the error propagates through Effect.all, causing the SIGTERM phase to fail and short-circuiting the SIGKILL escalation phase. This leaves orphaned serve processes alive. Effect.ignore both discards the value and suppresses errors, making killDirectChild infallible and allowing the full kill chain to complete. Also fix the same issue in the Windows path of killOpenCodeProcessGroup.
1 parent b538723 commit b3ce952

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/server/src/provider/opencodeRuntime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () {
450450

451451
const killOpenCodeProcessGroup = (signal: NodeJS.Signals) =>
452452
process.platform === "win32"
453-
? child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.asVoid)
453+
? child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.ignore)
454454
: Effect.sync(() => {
455455
try {
456456
process.kill(-Number(child.pid), signal);
@@ -461,7 +461,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () {
461461
}
462462
});
463463
const killDirectChild = (signal: NodeJS.Signals) =>
464-
child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.asVoid);
464+
child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.ignore);
465465
const killMatchingServeProcesses = (signal: NodeJS.Signals) =>
466466
terminateMatchingOpenCodeServeProcesses({
467467
binaryPath: input.binaryPath,

0 commit comments

Comments
 (0)