-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Panics while loading assets kill IoThreads preventing assets to be further loaded #2302
Copy link
Copy link
Closed
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
Bevy version
main branch c4b8210
Operating system & version
Fedora 33
What you did
Write any AssetLoader that panics, like so:
#[derive(Default)]
pub struct EvilLoader;
impl AssetLoader for EvilLoader {
fn load<'a>(
&'a self,
bytes: &'a [u8],
load_context: &'a mut LoadContext,
) -> BoxedFuture<'a, Result<()>> {
Box::pin(async move { panic!("malevolence") })
}
fn extensions(&self) -> &[&str] {
&["evil"]
}
}Any attempt to load the evil asset will kill the IO Thread, in a 4 thread cpu like mine this means that if I got 1 panic not asset can be loaded after
What you expected to happen
A panic should closes bevy or at least restart the IO Thread so the app doesn't hangs
What actually happened
Bevy just hangs and nothing else loads
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior