Skip to content

Correctly handle LSP shutdown/exit#2486

Merged
mergify[bot] merged 4 commits into
masterfrom
handle-shutdown
Dec 14, 2021
Merged

Correctly handle LSP shutdown/exit#2486
mergify[bot] merged 4 commits into
masterfrom
handle-shutdown

Conversation

@pepeiborra

@pepeiborra pepeiborra commented Dec 13, 2021

Copy link
Copy Markdown
Collaborator

The LSP spec says:

The shutdown request is sent from the client to the server. It asks the server to shut down, but to not exit (otherwise the response might not be delivered correctly to the client). There is a separate exit notification that asks the server to exit. Clients must not send any notifications other than exit or requests to a server to which they have sent a shutdown request. Clients should also wait with sending the exit notification until they have received a response from the shutdown request.

We are doing the shut down in the Exit notification handler, which is too late.

@michaelpj michaelpj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea if this is visible, presumably it's not easy to test that we do something sensible here.

@pepeiborra pepeiborra added the merge me Label to trigger pull request merge label Dec 13, 2021
@pepeiborra

Copy link
Copy Markdown
Collaborator Author

Before this change, the Shake profile for the last build when a test times out (using GHCIDE_BUILD_PROFILING) was a 0 bytes file because lsp-test kills the process shortly after sending the Exit notification. With this change, the last build profile is written correctly.

@mergify
mergify Bot merged commit b7949aa into master Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Label to trigger pull request merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants