rust-lang / rust-lang/rust-analyzer

Handle request retrying better

Open
#16,230 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Broken Window C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Currently a bunch of request handles may panic if we retry them after document changes have come in. This is obviously quite annoying for users, we should fix this. There are two ways I can see to go forward here

  1. Attach the current mem doc version of a file to requests that have files in them and bail if the versions dont line up when processing the request
  2. Replay any document changes that have happened since accepting the and processing the request and attempt to adjusting the offsets in the request before processing it.
  3. Replay any document changes that have happened since accepting the and processing the request and bail out if the offsets in the request may be affected.

All of these options are pretty bad, but we need to do something here unfortunately.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating request retry handling and document-change processing, then compare the three proposed strategies. Done means retries no longer panic when document changes arrive and affected request offsets are handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.