[runtime/7.0] [mono] Raise soft RLIMIT_NOFILE on Linux #83078
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Manual backport of #82429.
Replace darwin_change_default_file_handles by a new routine increase_descriptor_limit, which mirrors the logic in the CoreCLR INIT_IncreaseDescriptorLimit routine.
Fixes #82428.
Customer Impact
Running
dotnet restore
using the Mono runtime (e.g. on the s390x architecture) would under certain circumstances abort with a "Too many open files" error message. The details are documented in NuGet/Home#12410.It turned out that Mono does not raise the limit for open files like CoreCLR does. This change fixes that to align with CoreCLR.
Testing
Manual testing confirmed this fixes the problem.
Risk
Low, we're aligning the Mono behavior with CoreCLR and the affected codepath is only used on Desktop so doesn't impact the mobile/wasm workloads.