Skip to content

Make client read and write under mutex lock #433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2024

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
40 checks passed
@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