Skip to content

fix: avoid non-blocking read action on EDT during settings panel dispose - #1807

Merged
angelozerr merged 1 commit into
redhat-developer:mainfrom
angelozerr:fix/edt-runCancellableReadAction
Oct 31, 2026
Merged

angelozerr merged 1 commit into
redhat-developer:mainfrom
angelozerr:fix/edt-runCancellableReadAction

Conversation

@angelozerr

Copy link
Copy Markdown
Contributor

LanguageServerPanel.dispose() runs on the EDT and called resetJsonSchema(), which renamed the virtual file via LSPIJUtils.getFile() → runCancellableReadAction(). That uses ReadAction.nonBlocking().executeSynchronously() which is forbidden on the EDT per JetBrains threading rules.

During dispose the virtual file is about to be garbage-collected, so renaming it is unnecessary. Extract releaseJsonSchemaIndex() that only frees the schema provider slot, and call that from dispose() instead.

Fixes #1650

LanguageServerPanel.dispose() runs on the EDT and called
resetJsonSchema(), which renamed the virtual file via
LSPIJUtils.getFile() → runCancellableReadAction(). That uses
ReadAction.nonBlocking().executeSynchronously() which is forbidden
on the EDT per JetBrains threading rules.

During dispose the virtual file is about to be garbage-collected,
so renaming it is unnecessary. Extract releaseJsonSchemaIndex() that
only frees the schema provider slot, and call that from dispose()
instead.

Fixes redhat-developer#1650

Signed-off-by: azerr <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b3cad0d0-1424-4e2e-a147-3f62d54606bc
Commits

Reviewing files that changed from the base of the PR and between b6d5ebf and b2d3f90.

Files selected for processing: 2
  • src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java
  • src/main/java/com/redhat/devtools/lsp4ij/settings/ui/SchemaBackedJsonTextField.java

@angelozerr
angelozerr merged commit 0d8f5d7 into redhat-developer:main Oct 31, 2026
7 checks passed
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.91%. Comparing base (b6d5ebf) to head (b2d3f90).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../lsp4ij/settings/ui/SchemaBackedJsonTextField.java 0.00% 3 Missing ⚠️
...vtools/lsp4ij/settings/ui/LanguageServerPanel.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1807      +/-   ##
==========================================
+ Coverage   36.76%   36.91%   +0.15%     
==========================================
  Files         783      783              
  Lines       29923    29926       +3     
  Branches     4534     5987    +1453     
==========================================
+ Hits        11000    11046      +46     
+ Misses      17012    16967      -45     
- Partials     1911     1913       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access from Event Dispatch Thread (EDT) is not allowed;

2 participants