fix(cli): harden no-daemon teardown
This commit is contained in:
8
cli.ts
8
cli.ts
@@ -79,10 +79,10 @@ async function runInProcess(
|
||||
const result = await runCommand(cmdArg, client, uri, params);
|
||||
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
||||
} finally {
|
||||
// Fire-And-Forget Shutdown - With `gopls -remote=auto` (and similar)
|
||||
// the spawned process is a thin client to a background daemon; a
|
||||
// graceful shutdown can hang the parent. Kick it off but don't wait.
|
||||
void client.dispose();
|
||||
// Hard Teardown - The no-daemon path is short-lived/debug-only. Avoid
|
||||
// graceful JSON-RPC shutdown because the server stdio stream may already
|
||||
// be closed, which can surface ERR_STREAM_DESTROYED during process exit.
|
||||
void client.dispose({ graceful: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user