Skip to content

fix(51100): ensure tsserver shuts down when parent process is killed#51107

Merged
sheetalkamat merged 2 commits into
microsoft:mainfrom
rchl:fix/tsserver-ipc-exit
Oct 10, 2022
Merged

fix(51100): ensure tsserver shuts down when parent process is killed#51107
sheetalkamat merged 2 commits into
microsoft:mainfrom
rchl:fix/tsserver-ipc-exit

Conversation

@rchl
Copy link
Copy Markdown
Contributor

@rchl rchl commented Oct 8, 2022

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 does when pipe to the parent process is destroyed.

Initially I've moved the exit implementation from IOSession to the base Session to avoid having it duplicated in IOSession and IpcIOSession but changed so that implementations are duplicated after @sheetalkamat's comment. It's unfortunate that this creates duplication that could potentially go out of sync. I guess potentially there could be intermediary class that have this shared logic but that might be overkill.
EDIT: IpcIOSession inherits IOSession so we don't have to duplicate it.

Fixes #51100

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsserver doesn't shut itself down when the parent process is killed

3 participants