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

avoid overloading ls with completion resolve requests #10539

Merged
merged 2 commits into from
Apr 22, 2024

Commits on Apr 21, 2024

  1. Configuration menu
    Copy the full SHA
    523018e View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. don't overload LS with completion resolve requests

    While moving completion resolve to the event system in #9668 we introduced what
    is essentially a "DOS attack" on slow LSPs. Completion resolve requests were
    made in the render loop and debounced with a timeout. Once the timeout expired
    the resolve request was made. The problem is the next frame would immediately
    request a new completion resolve request (and mark the old one as obsolete but
    because LSP has no notion of cancelation the server would still process it). So
    we were in essence sending one completion request to the server every 150ms and
    only stopped if the server managed to respond before we rendered a new frame.
    This caused overload on slower machines/with slower LS.
    
    In this PR I revamped the resolve handler so that a request is only ever
    resolved once. Both by checking if a request is already in-flight and by marking
    failed resolve requests as resolved.
    pascalkuthe committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    5f070f8 View commit details
    Browse the repository at this point in the history