Skip to content

Commit 123e5ba

Browse files
hbw00111maria-rcks
andauthored
fix(server): force-stop timed out login shell probes (pingdotgg#7295)
Co-authored-by: hbw00111 <[email protected]> Co-authored-by: maria-rcks <[email protected]>
1 parent d897d3f commit 123e5ba

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎packages/shared/src/shell.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ describe("readEnvironmentFromLoginShell", () => {
135135
SSH_AUTH_SOCK: "/tmp/secretive.sock",
136136
});
137137
expect(execFile).toHaveBeenCalledTimes(1);
138+
expect(execFile).toHaveBeenCalledWith("/bin/zsh", expect.any(Array), {
139+
encoding: "utf8",
140+
timeout: 5000,
141+
killSignal: "SIGKILL",
142+
detached: true,
143+
stdio: ["ignore", "pipe", "ignore"],
144+
});
138145
});
139146

140147
it("omits environment variables that are missing or empty", () => {

‎packages/shared/src/shell.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type ExecFileSyncLike = (
2424
options: {
2525
encoding: "utf8";
2626
timeout: number;
27+
killSignal?: NodeJS.Signals | number;
2728
detached?: true;
2829
stdio?: ["ignore", "pipe", "ignore"];
2930
},
@@ -302,6 +303,7 @@ export const readEnvironmentFromLoginShell: ShellEnvironmentReader = (
302303
const output = execFile(shell, ["-ilc", buildEnvironmentCaptureCommand(shell, names)], {
303304
encoding: "utf8",
304305
timeout: 5000,
306+
killSignal: "SIGKILL",
305307
detached: true,
306308
stdio: ["ignore", "pipe", "ignore"],
307309
});

0 commit comments

Comments
 (0)