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

Use correct error response for cancellations #2939

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Nov 29, 2024

Motivation

While working on #2938, I noticed that our request cancellation response was incorrect. The spec determines that requests that got cancelled by the client need to return an error using the code for request cancelled (see here and see RequestCancelled here).

Implementation

Started returning an error with the right code, rather than a response with a nil body.

I also started running cancel notifications directly in the main thread without pushing it to the queue, which was another mistake. If we put that notification in the queue, then we're guaranteed to only process them after we finish running requests, which is useless. We need the ability to process them as soon as we receive the notification, so that we have enough time to cancel the requests.

Automated Tests

Added a test to verify this.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock added server This pull request should be included in the server gem's release notes bugfix This PR will fix an existing bug labels Nov 29, 2024 — with Graphite App
@vinistock vinistock marked this pull request as ready for review November 29, 2024 19:46
@vinistock vinistock requested a review from a team as a code owner November 29, 2024 19:46
@vinistock vinistock force-pushed the 11-29-use_correct_error_response_for_cancellations branch from 3f7505f to adcfca5 Compare November 29, 2024 21:26
@vinistock vinistock merged commit 0a82b93 into main Nov 29, 2024
35 of 36 checks passed
@vinistock vinistock deleted the 11-29-use_correct_error_response_for_cancellations branch November 29, 2024 21:49
vinistock added a commit that referenced this pull request Jan 8, 2025
### Motivation

This is a temporary revert to fix #3019 while we understand the correct response flow for retried cancelled requests.

This PR reverts the behaviour introduced in #2939, which didn't cause problems for NeoVim.

### Implementation

I didn't perform a full revert of every single change, since we do want to ensure that we're following the spec. I just stopped returning the error and went back to returning a `nil` response until we figure out what's going on.

### Automated Tests

Changed the test so that it asserts the current behaviour. We'll switch it back later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants