Skip to content
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

Creating Multiple WebView2 Instances causes 0x8007139f error on one Instance #2703

Closed
mingchengzack opened this issue Aug 19, 2022 · 6 comments
Labels
bug Something isn't working status-circle back Check back after requesting general information. tracked We are tracking this work internally.

Comments

@mingchengzack
Copy link

mingchengzack commented Aug 19, 2022

Description
When we try to run two sample apps WebView2APISample at the same time, run .\WebView2APISample.exe ; .\WebView2APISample.exe , one instance pops up the error of 0x8007139f.
Screenshot 2022-08-19 113426

Version
SDK: 1.0.1340-prerelease (but should be reproduced with 1.0.1293.44 as well)
Runtime: 104.0.1293.54
Framework: Win32
OS: Win 11

AB#41026429

@mingchengzack mingchengzack added the bug Something isn't working label Aug 19, 2022
@victorthoang victorthoang added the status-circle back Check back after requesting general information. label Aug 21, 2022
@victorthoang
Copy link

@mingchengzack I will ask around and see if I can find someone best suited to investigate this. Thanks!

@Syul968
Copy link
Contributor

Syul968 commented Aug 22, 2022

Hi @mingchengzack,

This is a racing condition where the WebView2 Runtime configuration appears to be different for the two app processes requesting creation. Delaying the second launch a bit will prevent the race. Is this an issue for your project?

Thanks,
Luis

@Syul968 Syul968 added the tracked We are tracking this work internally. label Aug 22, 2022
@mingchengzack
Copy link
Author

Hi @mingchengzack,

This is a racing condition where the WebView2 Runtime configuration appears to be different for the two app processes requesting creation. Delaying the second launch a bit will prevent the race. Is this an issue with your project?

Thanks, Luis

Yes as we can launch two our apps at the same time. Is there a better way to prevent this? Also is it possible to prevent this racing condition on your side as we are using the same environment options which shouldn't cause this configuration different problem?

@Syul968
Copy link
Contributor

Syul968 commented Aug 22, 2022

I have opened a work item on our end to track this. The issue is well understood and I'm working on a fix but it will take a while to be available since this is happening in the WebView2 Runtime. If checked in right now, it would reach WebView2 Runtime for our 106 release in late September per our Release Schedule.

Unfortunately, there's no other workaround since this is in the WebView2 Runtime. If you know the environment configuration is the same, your app can handle errorCode ERROR_INVALID_STATE to retry creation with ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.

@mingchengzack
Copy link
Author

@Syul968 Thanks. We are going to go with retry for now. Could you update in this thread when you guys get the fix in?

@Syul968
Copy link
Contributor

Syul968 commented Aug 25, 2022

The fix is now available in 1361+ builds and is expected to reach the WebView2 Runtime for our 106 release: Release Schedule.

You can test the fix for your application by installing latest Edge Canary Channel and setting the channel preference for you app: Approaches to making your app use a specific browser channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status-circle back Check back after requesting general information. tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

3 participants