Repository navigation
Make inlined annotation updates safe against a concurrent uninstall - #4463
Merged
vogella merged 1 commit intoOct 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The pre-lock null check can still let an in-progress update publish annotations after uninstall.
1 open finding
What changed in this PR
Improves thread safety when code-mining annotations are accessed during rendering and editor shutdown.
Changes:
- Makes the annotation set volatile.
- Uses local snapshots to avoid inconsistent repeated reads.
| File | Description |
|---|---|
InlinedAnnotationSupport.java |
Publishes and reads annotation sets safely across threads. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vogella
force-pushed
the
lv/inlined-annotations-race
branch
from
October 9, 2026 07:55
685c025 to
9ba286a
Compare
vogella
force-pushed
the
lv/inlined-annotations-race
branch
3 times, most recently
from
October 13, 2026 16:08
576f1c9 to
d805b99
Compare
CodeMiningManager renders on the thread that completes the providers' futures, so InlinedAnnotationSupport replaces its inlined annotations from a background thread while the UI thread hit-tests them and uninstall clears them. The field was not volatile and several methods read it twice, for the null check and for the loop, so clearing it in between threw a NullPointerException that CodeMiningManager logged. An update that was still running during uninstall could also add its annotations to the model after uninstall had removed them. The field is now volatile and every reader works on a single read, and uninstall sets a flag that an update checks under the annotation model lock before it changes the model. Assisted-by: multiple AI agents and layers of automated tooling 🤖
vogella
force-pushed
the
lv/inlined-annotations-race
branch
from
October 13, 2026 21:01
d805b99 to
5ff798d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Code minings are rendered on the thread that completes the providers' futures, so
InlinedAnnotationSupportreplaces its set of inlined annotations from a background thread while the UI thread hit-tests them and uninstalling the support clears them. The field was not volatile and several methods read it twice, once for the null check and once for the loop, so an editor closing during a render could throw a NullPointerException thatCodeMiningManagerlogs as an error. An update still running during uninstall could also add its annotations to the model after uninstall had removed them. The field is now volatile and every reader works on a single read, and uninstall sets a flag that an update checks under the annotation model lock before it touches the model. This complements #4438, which removed the ConcurrentModificationException in the same render path.