-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
LSP: Pipes get clogged #229
Comments
Users of |
Fixing in #237. |
I don't see a way to do this efficiently on Windows.
|
An untested idea:
This would avoid the deadlock inefficiently, but wouldn't really harm well-written clients. I think this proposal isn't worth implementing. |
I'm going to punt on this task. Fixing this issue isn't worth the complexity (Linux) or the [theorized] performance hit (Windows). Saved my progress to refs/archive/lsp-deadlock. |
In order to support config file change notifications (coming from the filesystem) in the LSP server, we need to make an event pump anyway. So we may as well make our event pump not have deadlocks.
I suspect this plan will fail because overlapped I/O is unsupported (therefore a synchronous "overlapped" WriteFile won't be cancellable by CancelIoEx). I think we need to have a separate thread dedicated to calling I think we can make I think a |
lsp_pipe_writer has two code paths: * writev: convert the message byte_buffer into a byte_buffer_iovec, and use the writev syscall to write data to the pipe * no-writev: convert the message byte_buffer into a string8, and use the write/WriteFile syscall to write data to the pipe Having two code paths complicates future changes, such as scheduling WriteFile on a separate thread [1]. Settle on one code path as much as possible: * writev: convert the message byte_buffer into a byte_buffer_iovec, and use the writev syscall to write data to the pipe * no-writev: convert the message byte_buffer into a byte_buffer_iovec (same code as if writev is supported), and use the write/WriteFile syscall to write data to the pipe This commit possibly harms performance by calling WriteFile more (with smaller buffers) on Windows. I didn't attempt to measure this performance difference. [1]: #229
In
--lsp-server
mode, if the client sends a bunch of requests, but does not read from quick-lint-js' stdout, quick-lint-js can hang while responding to the requests, and the client can hang while sending more requests. (This came up when benchmarking, because my LSP client naively made a bunch of requests without reading responses.)The text was updated successfully, but these errors were encountered: