Skip to content

[WIP] Wake the startup event loop with queued work instead of display.wake() - #4297

Draft
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:workbench-advisor-wake-race
Draft

[WIP] Wake the startup event loop with queued work instead of display.wake()#4297
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:workbench-advisor-wake-race

Conversation

@vogella

@vogella vogella commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

WorkbenchAdvisor.openWindows() restores the workbench state on a separate thread while the UI thread spins the event loop. A display.wake() sent before the UI thread reaches Display.sleep() is dropped, which bug 429363 papered over with a 5 ms sleep in the init thread. Queuing an empty StartupRunnable closes that race instead of narrowing it, because Display.sleep() returns immediately when the synchronizer has pending messages, on gtk, win32 and cocoa alike. It has to be a StartupRunnable, since UISynchronizer defers plain runnables until the workbench is up.

This path runs on every IDE start, IDEWorkbenchAdvisor does not override openWindows(), so it also saves the 5 ms. Draft because the lost wakeup is timing dependent and no test reproduces it, so the reasoning is what needs a second pair of eyes.

WorkbenchAdvisor.openWindows() restores the workbench state on a separate
thread while the UI thread spins the event loop. A wake() sent before the UI
thread reaches Display.sleep() is dropped, which bug 429363 papered over with
a 5 ms sleep in the init thread.

Queue an empty StartupRunnable instead: Display.sleep() returns immediately
when the synchronizer has pending messages, so the wakeup cannot be lost.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the workbench-advisor-wake-race branch from 0a41584 to bdbf651 Compare August 30, 2026 12:14
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ±0     858 suites  ±0   50m 53s ⏱️ + 4m 55s
 8 174 tests ±0   7 931 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 424 runs  ±0  19 768 ✅ ±0  656 💤 ±0  0 ❌ ±0 

Results for commit bdbf651. ± Comparison against base commit 661ed2e.

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