-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Temporary fix to prevent panics on loading Gltf assets in parallel due to stack overlows #18186
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
base: main
Are you sure you want to change the base?
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
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.
Can you say more about why this fixes the issue observed?
Note that we won't merge commented out code, but let's work on getting the fix nice before working on polish.
Yeah no worries, this is mainly just to help out victor if he can't wait for a proper patch. Basically the bug is because blocking code is running within async code which is generally a bit of an anti-pattern, what Ultimately you could fix this and make it work but its not really deterministic or easy to rationalize. Better would be to make sure all your blocking code and async code run on different thread pools. |
Here's some background information you can read up on blocking inside async contexts https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html |
B.t.w. Now we are talking a bit more in actively and given we're on the topic of task management - I've solved the multi-threading problem in WASM running in the main browsers for other projects if you want some tips. |
@john-sharratt notes over in #4078 would be hugely appreciated! |
Objective
Temporary fix for
#15271
Solution
Disables the inline invocation of the task engine after loading a Gltf as the blocking call is causing task engine re-entrance and stack overflow
Testing
Tested on my local branch which is a fork, not directly tested on the issue raiser.
Further testing would be required before accepting this however this does fix my issue