Skip to content

Stopping a language server that held 100 or more closed documents logs "Too many non-blocking read actions submitted at once" #2097

Closed

Description

@lagergren

When a language server stops, LSP4IJ clears the Project view problems of the closed documents it held, and submits a non-blocking read action for each of their files at once. With 100 or more files, IntelliJ logs an error:

java.lang.Throwable: Too many non-blocking read actions submitted at once. Please use coalesceBy, BoundedTaskExecutor or another way of limiting the number of concurrently running threads.: 99 with similar stack traces are currently active
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:378)
	at com.intellij.openapi.application.impl.SubmissionTracker.preventTooManySubmissions(SubmissionTracker.java:47)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.<init>(NonBlockingReadActionImpl.java:363)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.submit(NonBlockingReadActionImpl.java:306)
	at com.redhat.devtools.lsp4ij.features.diagnostics.LSPDiagnosticUtils.reportProblem(LSPDiagnosticUtils.java:80)
	at com.redhat.devtools.lsp4ij.features.diagnostics.LSPDiagnosticUtils.lambda$clearProblem$1(LSPDiagnosticUtils.java:176)
	...

Seen with LSP4IJ 0.30.1 in IntelliJ 2026.2.3; main (1b44654) has the same code. A language server whose diagnostics cover closed files, as one whose workspace diagnostics LSP4IJ pulls, leaves a closed document for each file it reported, so stopping or restarting it in a large project reaches 100 easily. We met it in our UI test, which stops the language server while it has work pending, after earlier steps had left many files with errors.

Cause

It comes from our #1868, which made the clear go through a report of each file.

  • When a language server stops, LanguageServerWrapper.stop passes all of its closed documents to LSPDiagnosticUtils.clearProblem at once.
  • clearProblem runs one non-blocking read action, which calls reportProblem for each file. Each call submits a non-blocking read action of its own, coalesced by its file, so none merge: a clear of n files submits n read actions together, and IntelliJ's SubmissionTracker logs an error once 100 are active.

Suggested fix

The clear has to keep what #1868 gives it: a file's reports run one after another, the last submitted last, so a clear never runs after a report of errors published since. It must do that without a read action for each file at once. A test can stop a language server that holds 150 closed documents with errors, and expect their problems cleared and no error logged.

Activity

  1. added this to the 0.30.2 milestone on Nov 22, 2026
  2. added
    bug
    on Nov 22, 2026
  3. added 9 commits that reference this issue on Nov 23, 2026
    cdb0a2b
    efcb185
    55f625a
    88863de
    73afd02
    8c1bc5c
    c641f51
    7b744cc
    73d4313
  4. 5 remaining items

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

    bugdiagnostic

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions