Repository navigation
fix: clear the problems of a stopped language server's files one after another, not with a read action for each at once - #2101
Conversation
…r another, not with a read action for each at once When a language server stops, the clear of its closed documents submitted a report of each file at once, from one read action. With 100 or more files, IntelliJ logs "Too many non-blocking read actions submitted at once". The clear now submits the report of a file once the report of the file before it is processed, from a pooled thread. Each report is still coalesced with the other reports of its file, so a report of errors published since runs after the clear's report of the file, or replaces it.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2101 +/- ##
==========================================
+ Coverage 50.34% 50.43% +0.08%
==========================================
Files 816 816
Lines 33785 33825 +40
Branches 6962 6961 -1
==========================================
+ Hits 17008 17058 +50
+ Misses 14129 14122 -7
+ Partials 2648 2645 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
Action not completed
|
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
|
@coderabbitai review |
Action not completed
|
|
@coderabbitai review |
Action not completed
|
|
@coderabbitai review |
Action performed
|
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
UP80 is fixed by our redhat-developer/lsp4ij#2096 and UP81 by our redhat-developer/lsp4ij#2101, both open for 0.30.2. xvm #741 lists them, with our other LSP4IJ pull requests for XTC since 0.30.0.
Fixes #2097
What
Stopping a language server that held 100 or more closed documents logged "Too many non-blocking read actions submitted at once". It now clears the problems of their files one file after another.
Cause
LanguageServerWrapper.stoppasses all of its closed documents toLSPDiagnosticUtils.clearProblem. Since #1868, the clear's read action callsreportProblemfor each file. Each report is a non-blocking read action coalesced by its file, so none of them merge: a clear of n files submitted n read actions at once, and IntelliJ'sSubmissionTrackerlogs an error once 100 are active.Change
The clear still resolves its files and asks the client's
canReportProblemin one background read action. It then submits the report of the first file only:onProcessedruns its callback at once if the report is already done, and otherwise on the thread that completes it, which can be the EDT. The callback therefore only hands the next report to a pooled thread. The chain never grows the stack, and the EDT never submits a report.What #1868 needs is kept. Each report is still coalesced with the other reports of its file, and computes the mark from the errors held when it runs. A report of errors published since, submitted before or after the clear's report of the file, runs after it or replaces it.
reportProblem(VirtualFile, LSPDocumentBase, Project)keeps its publicvoidsignature. A new private method submits the report and returns its promise.Test
ClosedDocumentProblemTesthas two new tests:testAServerThatStopsWithManyClosedDocumentsWithErrorsClearsTheirProblemsOneFileAfterAnother: a language server holding 150 closed documents with errors stops.Too many non-blocking read actions submitted at once. ...: 11 with similar stack traces are currently active, and 148 reports run at once. With the fix, it passes.testAFileWhoseErrorIsPublishedWhileAClearReportsAnEarlierFileStaysAProblemFileWhenTheClearReachesIt: a clear of three files is held at its report of the first file while an error is published for the second. Once the clear reaches the second file, that file must still be a problem file. It passes with and without the fix, and fails if the clear's reports ignore the errors held.No test waits on time: the bounds only end a hang. Locally on 2024.2, the diagnostics tests and
ClosedDocumentProblemTestpass (90 tests), and so does the full suite (1846 tests, 7 skipped: Windows-only and external-tool tests).Not changed
Other loops submit a read action per file in the same way, and could log the same error with 100 or more files:
stop()disconnects each opened document with its own one-file clear;LanguageServerWrapper.clearClosedDocumentDiagnostics(identifier)callsupdateDiagnostics, and soreportProblem, for each closed document;