Skip to content

Serialize LoadTargetDefinitionJob per target handle#2338

Draft
vogella wants to merge 1 commit into
eclipse-pde:masterfrom
vogella:serialize-load-target-job
Draft

Serialize LoadTargetDefinitionJob per target handle#2338
vogella wants to merge 1 commit into
eclipse-pde:masterfrom
vogella:serialize-load-target-job

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 18, 2026

Clicking "Reload Target Platform" on the editor toolbar cancels the in-flight load and immediately schedules a new one, but Job.cancel only flips a flag, so the cancelled job keeps running until its next monitor check. Repeated clicks therefore pile up "Load Target Platform (Cancel Requested)" entries in the Progress view, and two loads of the same target can race on the p2 profile lock/unlock pair inside P2TargetUtils.deleteProfile.

Commit 37f88d7 addressed the same pattern for the editor's resolve job but did not cover the explicit Reload action, which also calls target.resolve() internally. This change promotes the per-target-handle scheduling rule from TargetEditor into a shared TargetResolveSchedulingRule and applies it to both LoadTargetDefinitionJob and the editor's resolve job, so loads and resolves of the same target serialize while operations on different targets remain independent.

Planned for 4.41.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

Test Results

  126 files  ±0    126 suites  ±0   38m 10s ⏱️ + 3m 5s
3 510 tests ±0  3 456 ✅ ±0   54 💤 ±0  0 ❌ ±0 
9 333 runs  ±0  9 203 ✅ ±0  130 💤 ±0  0 ❌ ±0 

Results for commit e7236a6. ± Comparison against base commit 4f1f320.

♻️ This comment has been updated with latest results.

Clicking "Reload Target Platform" on the editor toolbar calls
LoadTargetDefinitionJob.load(target), which cancels any prior load via
Job.getJobManager().cancel(JOB_FAMILY_ID) and immediately schedules a
new one. Job.cancel only sets a flag, so the in-flight load keeps
running until its next monitor check. Repeat clicks therefore pile up
"Load Target Platform (Cancel Requested)" entries plus their submonitor
"Loading target platform information: Reading plug-ins" lines in the
Progress view, and two loads of the same target can race on the p2
profile lock/unlock pair inside P2TargetUtils.deleteProfile.

Commit 37f88d7 fixed the same pattern for the editor's resolve job
but did not cover the explicit Reload action, which also calls
target.resolve() internally.

Promote the per-target-handle ISchedulingRule from TargetEditor into a
shared TargetResolveSchedulingRule under
org.eclipse.pde.internal.core.target, and apply it to both
LoadTargetDefinitionJob and the editor's resolve job. Because both
jobs now share the same rule keyed by the handle memento, a Reload
also serializes against an in-flight editor resolve for the same
target. Operations on different targets remain independent.
@vogella vogella force-pushed the serialize-load-target-job branch from 4af23b0 to e7236a6 Compare May 18, 2026 14:08
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.

1 participant