-
Notifications
You must be signed in to change notification settings - Fork 187
[Win32] Avoid blocking operations on Edge due to OS message processing #1776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Win32] Avoid blocking operations on Edge due to OS message processing #1776
Conversation
bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java
Outdated
Show resolved
Hide resolved
laeubi
left a comment
There was a problem hiding this 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!
bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java
Show resolved
Hide resolved
b636d80 to
f9ec1ae
Compare
| 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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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)); |
There was a problem hiding this comment.
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.
509ef17 to
c5d6408
Compare
63d3dbb to
75e622a
Compare
bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java
Outdated
Show resolved
Hide resolved
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
left a comment
There was a problem hiding this 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).
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: