-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[WASM] Fix async/await in config loading #54652
Conversation
Tagging subscribers to this area: @CoffeeFlux Issue DetailsRemoved the async/await from mono-config.json loading and reverted to using callbacks as the async caused race conditions as emscripten does not await async functions. Fixes issue: #54643
|
I think we should figure out why addRunDependency is failing here blazor uses it successfully from Module.preRun in multiple places |
My guess would be that as I suggested in comments on the earlier PR, because removeRunDependency instantly invokes the callback once it's ready, the async function hasn't returned yet so the config has not been stored in the appropriate place by the time the other code looks for it (that won't happen until the next turn of the event loop) |
yeah, I think we can follow the pattern of returning a promise and awaiting that when setting the config (like blazor does) |
151fe8f
to
e40e997
Compare
This latest push undoes the previous 4 commits and reverts the async/await. However (thanks to Larry) this approach also seems to work |
…mono-config-again
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.
Needs to fix the hot reload test as well
This new solution 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.
Yes that's exactly what I did haha :) |
Test failures look infrastructure related and this issue is causing CI instability. |
…bugger2 * origin/main: (107 commits) Disable MacCatalyst arm64 PR test runs on staging pipeline (dotnet#54678) [WASM] Fix async/await in config loading (dotnet#54652) Fix for heap_use_after_free flagged by sanitizer (dotnet#54679) [wasm] Bump emscripten to 2.0.23 (dotnet#53603) Fix compiler references when building inside VS (dotnet#54614) process more TLS frames at one when available (dotnet#50815) Add PeriodicTimer (dotnet#53899) UdpClient with span support (dotnet#53429) exclude fragile tests (dotnet#54671) get last error before calling a method that might fail as well (dotnet#54667) [FileStream] add tests for device and UNC paths (dotnet#54545) Fix sporadic double fd close (dotnet#54660) Remove Version.Clone from AssemblyName.Clone (dotnet#54621) [wasm] Enable fixed libraries tests (dotnet#54641) [wasm] Fix blazor/aot builds (dotnet#54651) [mono][wasm] Fix compilation error on wasm (dotnet#54659) Fix telemetry for Socket connects to Dns endpoints (dotnet#54071) [wasm] Build static components; include hot_reload in runtime (dotnet#54568) [wasm][debugger] Reuse debugger-agent on wasm debugger (dotnet#52300) Put Crossgen2 in sync with dotnet#54235 (dotnet#54438) ...
Fixed the async loading of mono-config.json to fix issue #54643