Skip to content

A stopping language server is sent requests, such as textDocument/codeLens, after its shutdown request #2145

Closed

Description

@lagergren

What happens

A language server that is stopping can be sent a request after its shutdown request. The LSP specification says that, once the client has sent shutdown, it sends nothing but the exit notification.

CancelRequestAfterShutdownTest.testARequestCancelledOnceTheShutdownIsSentSendsNoCancelRequest caught it on main's CI at 1e40358 (run 45186700307, Linux, IntelliJ 2024.2):

junit.framework.AssertionFailedError: The language server must read nothing but exit after shutdown
expected:<[shutdown, exit]> but was:<[shutdown, textDocument/codeLens, exit]>

The editor's background textDocument/codeLens request went out after shutdown. The next commit's CI passed, so it depends on timing.

Why

#2105 stops a stopping language server from being sent $/cancelRequest once shutdown is queued (OutgoingMessages in LanguageServerWrapper). A request that a feature starts while the server stops, as Code Vision's code lens, still goes out.

Expected

Once shutdown is queued, nothing but exit is written to the language server. A request made after that ends at once, as the requests of a stopped language server do.

The test also doesn't switch off Code Vision, as #2120 did for a similar race. But the language server must not be sent the request whatever starts it.

Activity

  1. added this to the 0.30.2 milestone on Nov 23, 2026
  2. added
    bug
    on Nov 23, 2026
  3. added a commit that references this issue on Nov 23, 2026
    53fd2f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions