Skip to content

Conversation

@mockersf
Copy link
Member

@mockersf mockersf commented Jan 17, 2026

Objective

ERROR bevy_asset::server: Encountered an I/O error while loading asset: Too many open files (os error 24)

Solution

  • on iOS and macOS, add a Semaphore to ensure we're not opening more than 128 files in parallel

Testing

  • cargo run --release --package bistro works without errors in the log

@mockersf mockersf added A-Assets Load files from disk to use for things like images, models, and sounds O-MacOS Specific to the MacOS (Apple) desktop operating system O-iOS Specific to the iOS mobile operating system labels Jan 17, 2026
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jan 17, 2026
@alice-i-cecile alice-i-cecile added the C-Bug An unexpected or incorrect behavior label Jan 17, 2026
@alice-i-cecile alice-i-cecile added this to the 0.18.1 milestone Jan 17, 2026
Copy link
Contributor

@andriyDev andriyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little nervous to do this: you could end up with every running loader acquiring a single file, but then needing a second file to complete, and then being deadlocked.

It's unclear whether this is better than just failing to load. I guess so since it's less likely that users have 128 assets that also need a second file load to complete (e.g., an immediate load). Though having 128 gltfs that reference other textures isn't completely impossible.

root_path,
#[cfg(all(
feature = "multi_threaded",
any(target_os = "macos", target_os = "ios")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also be doing this on Linux. I believe Linux's default is 1024.

@andriyDev
Copy link
Contributor

Also this doesn't take into consideration multiple asset sources. This might need to be a global semaphore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior O-iOS Specific to the iOS mobile operating system O-MacOS Specific to the MacOS (Apple) desktop operating system S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On iOS, loading many assets in AssetMode::Processed causes some assets to fail to load

3 participants