Skip to content

Commit 9c87ded

Browse files
authoredOct 10, 2022
fix(51100): ensure tsserver shuts down when parent process is killed (#51107)
* fix(51100): ensure tsserver shuts down when parent process is killed When using IPC channel (`--useNodeIpc`) for communicating with tsserver, the child tsserver process did not shut down on parent process disconnecting (for example due to it being killed). Call exit() on IPC disconnect, same as stdio-based communication did when pipe to parent process was destroyed. * don't duplicate inherited method
1 parent c01ae01 commit 9c87ded

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/tsserver/nodeServer.ts

+4
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,10 @@ namespace ts.server {
783783
process.on("message", (e: any) => {
784784
this.onMessage(e);
785785
});
786+
787+
process.on("disconnect", () => {
788+
this.exit();
789+
});
786790
}
787791
}
788792

0 commit comments

Comments
 (0)
Please sign in to comment.