-
Notifications
You must be signed in to change notification settings - Fork 182
Fix "no more handles" exception during Edge browser creation #660
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
Conversation
Test Results 299 files ±0 299 suites ±0 8m 15s ⏱️ + 2m 25s For more details on these failures, see this check. Results for commit ed8f821. ± Comparison against base commit 86616f0. ♻️ This comment has been updated with latest results. |
bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java
Show resolved
Hide resolved
3a7dce1
to
7975689
Compare
Thanks @HeikoKlare this affected on of my clients in the past. I suggest to merge. |
We also had to patch the issue behavior. It will be good to finally make it work properly inside the SWT. I would be glad if it would be merged. |
@Destrolaric can you already say whether this change makes your patch obsolete and fixes the behavior properly for you? From my side, we can merge this PR. I have validated proper instantiation of the Edge browser on my system in an isolated SWT application as well as in our RCP product. Should someone else validate before merging? |
@deepika-u Can you please verify the patch? |
…platform#339 The Edge browser creation uses Display.readAndDispath() to process the OS events for browser instantiation. When there are other asynchronous executions scheduled while the browser is being initialized, they may be processed in between the processing of browser-instantiating OS events if too much time elapses between them. In case such an asynchronous execution changes a state that makes the browser instantiation fail, such as disposing the composite parent of the browser, an exception occurs. In order to avoid the processing of asynchronous executions during browser instantiation, the change ensures that readAndDisplay() is only called when an OS event is present to be processed.
I have tried to recreate the problem of "No more handles" with below Snippet. package org.eclipse.swt.bugs; import org.eclipse.swt.; public class NoMoreHandles {
} When run seeing the below console output Then when i apply the patch, i am able to run it fine and not seeing any "No more handles". I have tried on below environment |
Specifically tried for Edge browser with below snippet once again and edge browser window comes up properly after the patch is applied. package org.eclipse.swt.bugs; import org.eclipse.swt.; public class NoMoreHandles {
} So patch looks good to me. |
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.
Approving, Thanks @deepika-u for verifying the patch.
Great, thanks for verifying, @deepika-u! |
Verified this on below build and looks good to me. Eclipse SDK |
The Edge browser creation uses
Display.readAndDispath()
to process the OS events for browser instantiation. When there are other asynchronous executions scheduled while the browser is being initialized, they may be processed in between the processing of browser-instantiating OS events if too much time elapses between them. In case such an asynchronous execution changes a state that makes the browser instantiation fail, such as disposing the composite parent of the browser, an exception occurs.In order to avoid the processing of asynchronous executions during browser instantiation, the change ensures that
readAndDisplay()
is only called when an OS event is present to be processed.A drawback of this approach is that in case the browser instantiation takes a long time, for whatever reasons, the UI will not be responsive as UI events are not processed. I do not think that this situation is likely to happen but want to mention it as a potential drawback of the solution.
Supposed to fix #339.