Skip to content

Increase file descriptor limit in native AOT executables #118995

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

Merged
merged 3 commits into from
Aug 23, 2025

Conversation

MichalStrehovsky
Copy link
Member

@MichalStrehovsky MichalStrehovsky commented Aug 22, 2025

Fixes #82719

Cc @dotnet/ilc-contrib

@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 12:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR consolidates file descriptor limit handling across .NET runtime components by moving the descriptor limit increase functionality from individual runtime implementations into the shared minipal library. This ensures consistent behavior across CoreCLR, Mono, and Native AOT executables.

Key changes:

  • Creates a unified minipal_increase_descriptor_limit() function in the minipal library
  • Removes duplicate descriptor limit code from CoreCLR PAL and Mono runtime
  • Adds descriptor limit increase functionality to Native AOT bootstrap

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/native/minipal/descriptorlimit.h New header defining the minipal descriptor limit API
src/native/minipal/descriptorlimit.c New implementation of descriptor limit increase functionality
src/native/minipal/minipalconfig.h.in Adds HAVE_RESOURCE_H configuration check
src/native/minipal/configure.cmake Adds sys/resource.h availability check
src/native/minipal/CMakeLists.txt Includes new descriptor limit source and disables functionality on problematic platforms
src/mono/mono/mini/driver.c Replaces local descriptor limit function with minipal version
src/mono/CMakeLists.txt Removes redundant DONT_SET_RLIMIT_NOFILE definition
src/coreclr/pal/src/init/pal.cpp Replaces local descriptor limit function with minipal version
src/coreclr/pal/src/CMakeLists.txt Removes redundant DONT_SET_RLIMIT_NOFILE definition
src/coreclr/nativeaot/Bootstrap/main.cpp Adds descriptor limit increase call to Native AOT bootstrap

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

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

Successfully merging this pull request may close these issues.

Increase file descriptor limit in NativeAOT app process
2 participants