Skip to content
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

Implement proper request cancellation #3063

Open
vinistock opened this issue Jan 14, 2025 · 0 comments
Open

Implement proper request cancellation #3063

vinistock opened this issue Jan 14, 2025 · 0 comments
Labels
bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale server This pull request should be included in the server gem's release notes

Comments

@vinistock
Copy link
Member

We currently have request cancellation implemented incorrectly. We are pushing the requests and their cancellation notification all in the incoming queue. Since Thread::Queue#pop pops items in the order in which they were pushed, we always see the cancellation after we already ran the request, which completely defeats the whole purpose of cancelling it.

We tried fixing that in #2939, but it caused issues for NeoVim #3019. We need to review our understanding of what needs to happen with a cancellation and ensure it's working properly.

What we need to clarify is if a request is cancelled, what should the server return once we get to that request? Current understanding is the error code RequestCancelled, but maybe it shouldn't return anything and should only return that error is the request is tried? In essence, what are the expectations from the server for the first response for a cancelled request and any subsequent ones?

Relevant spec page: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#cancelRequest

@vinistock vinistock added bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale server This pull request should be included in the server gem's release notes labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned This issue or pull request is pinned and won't be marked as stale server This pull request should be included in the server gem's release notes
Projects
None yet
Development

No branches or pull requests

1 participant