[Win32] Avoid blocking operations on Edge due to OS message processing#1776
Merged
fedejeanne merged 1 commit intoeclipse-platform:masterfrom Jan 30, 2025
Merged
Conversation
laeubi
reviewed
Jan 29, 2025
Contributor
laeubi
approved these changes
Jan 29, 2025
Contributor
laeubi
left a comment
There was a problem hiding this comment.
From code review point of view this seems a very good approach here and change is minimal enough!
laeubi
reviewed
Jan 29, 2025
laeubi
reviewed
Jan 29, 2025
b636d80 to
f9ec1ae
Compare
laeubi
reviewed
Jan 29, 2025
| 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)); |
Contributor
There was a problem hiding this comment.
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)); |
Contributor
Author
There was a problem hiding this comment.
I have moved this into properly typed, static constants and according initialization.
509ef17 to
c5d6408
Compare
63d3dbb to
75e622a
Compare
fedejeanne
reviewed
Jan 30, 2025
5045c34 to
e804ad6
Compare
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
e804ad6 to
ae05c94
Compare
fedejeanne
approved these changes
Jan 30, 2025
Member
fedejeanne
left a comment
There was a problem hiding this comment.
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).
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.
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: