Skip to content

Make inlined annotation updates safe against a concurrent uninstall - #4463

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/inlined-annotations-race
Oct 13, 2026
Merged

vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/inlined-annotations-race

Conversation

@vogella

@vogella vogella commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Code minings are rendered on the thread that completes the providers' futures, so InlinedAnnotationSupport replaces 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 that CodeMiningManager logs 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.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   48m 28s ⏱️ - 2m 32s
 8 461 tests +2   8 219 ✅ +2  242 💤 ±0  0 ❌ ±0 
21 261 runs  +6  20 578 ✅ +6  683 💤 ±0  0 ❌ ±0 

Results for commit 5ff798d. ± Comparison against base commit 52531af.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
vogella force-pushed the lv/inlined-annotations-race branch from 685c025 to 9ba286a Compare October 9, 2026 07:55
@vogella vogella changed the title Read the inlined annotations once per access Make inlined annotation updates safe against a concurrent uninstall Oct 9, 2026
@vogella
vogella force-pushed the lv/inlined-annotations-race branch 3 times, most recently from 576f1c9 to d805b99 Compare October 13, 2026 16:08
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
vogella force-pushed the lv/inlined-annotations-race branch from d805b99 to 5ff798d Compare October 13, 2026 21:01
@vogella
vogella merged commit 01bea36 into eclipse-platform:master Oct 13, 2026
18 checks passed
@vogella
vogella deleted the lv/inlined-annotations-race branch October 13, 2026 21:47
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.

2 participants