Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

The Edge browser implementation currently spins the event queue without any possibility to escape in case no OS message or not the expected OS message to proceed occurs and is processed.

In order to avoid that operations called on Edge deadlock, this change introduces timeouts for OS event processing inside Edge:

  • The existing processNextOSMessage() method is replaced with processOSMessagesUntil(condition) that spins the event queue until the condition is met or a timeout occurred
  • CompletableFutures used for the queuing events on the WebView instance are extended to wake the display in order to avoid that the OS message processing is unnecessary sleeping until a timeout wakes it up

@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2025

Test Results

   494 files  ±0     494 suites  ±0   11m 54s ⏱️ + 1m 23s
 4 333 tests ±0   4 320 ✅ ±0   13 💤 ±0  0 ❌ ±0 
16 574 runs  ±0  16 466 ✅ ±0  108 💤 ±0  0 ❌ ±0 

Results for commit ae05c94. ± Comparison against base commit 9aa7973.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

From code review point of view this seems a very good approach here and change is minimal enough!

@HeikoKlare HeikoKlare force-pushed the edge_os_timeout branch 2 times, most recently from b636d80 to f9ec1ae Compare January 29, 2025 15:43
private Browser createBrowser(Shell s, int flags) {
// TODO Reduce to reasonable value
long maximumBrowserCreationMilliseconds = 90_000;
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(maximumBrowserCreationMilliseconds));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(maximumBrowserCreationMilliseconds));
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(TimeUnit.SECONDS.toMilllis(90));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have moved this into properly typed, static constants and according initialization.

@HeikoKlare HeikoKlare force-pushed the edge_os_timeout branch 2 times, most recently from 509ef17 to c5d6408 Compare January 29, 2025 17:16
@HeikoKlare HeikoKlare marked this pull request as ready for review January 29, 2025 17:17
@HeikoKlare HeikoKlare force-pushed the edge_os_timeout branch 3 times, most recently from 63d3dbb to 75e622a Compare January 29, 2025 20:27
The Edge browser implementation currently spins the event queue without
any possibility to escape in case no OS message or not the expected OS
message to proceed occurs and is processed.

In order to avoid that operations called on Edge deadlock, this change
introduces timeouts for OS event processing inside Edge:
- The existing processNextOSMessage() method is replaced with
processOSMessagesUntil(condition) that spins the event queue until the
condition is met or a timeout occurred
- CompletableFutures used for the queuing events on the WebView instance
are extended to wake the display in order to avoid that the OS message
processing is unnecessary sleeping until a timeout wakes it up
Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

This PR looks good to go. As soon as the tests run, we can merge.

I re-triggered the pipeline 5 minutes ago since they had failed because of an unreachable URL before (hopefully just a hiccup).

@fedejeanne fedejeanne merged commit 7ad097a into eclipse-platform:master Jan 30, 2025
14 checks passed
@fedejeanne fedejeanne deleted the edge_os_timeout branch January 30, 2025 13:45
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.

3 participants