Skip to content

Conversation

@vinistock
Copy link
Member

Since the language server runs requests concurrently under threads, we should only read or write from the pipes under a mutex lock. Otherwise, we risk having mangled input/output, which will break the communication with the server.

@vinistock vinistock added the bugfix This PR fixes an existing bug label Aug 9, 2024
@vinistock vinistock self-assigned this Aug 9, 2024
@vinistock vinistock requested a review from a team as a code owner August 9, 2024 19:58
@vinistock vinistock requested review from andyw8 and st0012 August 9, 2024 19:58
@vinistock vinistock merged commit f3cb29d into main Aug 14, 2024
@vinistock vinistock deleted the vs-protect-client-with-mutex branch August 14, 2024 21:38
@andyw8
Copy link
Contributor

andyw8 commented Aug 15, 2024

@vinistock was this in response to a particular behaviour you were seeing, or just out of caution?

@vinistock
Copy link
Member Author

It might be related to the IncompleteMessage errors we are sometimes seeing. We have the same mutex synchronization in the Ruby LSP when writing/reading from pipes.

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

Labels

bugfix This PR fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants