Skip to content

[mono] Raise soft RLIMIT_NOFILE on Linux - #82429

Merged
akoeplinger merged 2 commits into
dotnet:mainfrom
uweigand:mono-rlimit-nofile
Mar 1, 2023
Merged

[mono] Raise soft RLIMIT_NOFILE on Linux#82429
akoeplinger merged 2 commits into
dotnet:mainfrom
uweigand:mono-rlimit-nofile

Conversation

@uweigand

@uweiganduweigand commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

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.

@ghostghost added the community-contribution Indicates that the PR has been added by a community member label Feb 21, 2023
Replace darwin_change_default_file_handles by a new routine
increase_descriptor_limit, which mirrors the logic in the
CoreCLR INIT_IncreaseDescriptorLimit routine.
Addresses #82428.
Comment threadsrc/mono/mono/mini/driver.c Outdated
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
@akoeplinger
akoeplinger merged commit 605d05b into dotnet:mainMar 1, 2023
@uweigand
uweigand deleted the mono-rlimit-nofile branch March 3, 2023 16:01
@uweigand

Copy link
Copy Markdown
ContributorAuthor

Thanks @akoeplinger ! Can this be backported to .NET 7 and possibly also .NET 6 ? We're seeing the same issue there as well.

@akoeplinger

Copy link
Copy Markdown
Member

/backport to release/7.0

@akoeplinger

Copy link
Copy Markdown
Member

/backport to release/6.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/4325553985

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/4325554484

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger backporting to release/7.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: [mono] Raise soft RLIMIT_NOFILE on Linux
Using index info to reconstruct a base tree...
M	src/mono/CMakeLists.txt
M	src/mono/mono/mini/driver.c
Falling back to patching base and 3-way merge...
Auto-merging src/mono/mono/mini/driver.c
Auto-merging src/mono/CMakeLists.txt
CONFLICT (content): Merge conflict in src/mono/CMakeLists.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 [mono] Raise soft RLIMIT_NOFILE on Linux
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger an error occurred while backporting to release/7.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger backporting to release/6.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: [mono] Raise soft RLIMIT_NOFILE on Linux
Using index info to reconstruct a base tree...
M	src/mono/CMakeLists.txt
M	src/mono/mono/mini/driver.c
Falling back to patching base and 3-way merge...
Auto-merging src/mono/mono/mini/driver.c
CONFLICT (content): Merge conflict in src/mono/mono/mini/driver.c
Auto-merging src/mono/CMakeLists.txt
CONFLICT (content): Merge conflict in src/mono/CMakeLists.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 [mono] Raise soft RLIMIT_NOFILE on Linux
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger an error occurred while backporting to release/6.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@akoeplinger

Copy link
Copy Markdown
Member

Looks like there are some merge conflicts, @uweigand would you mind preparing manual backports? thanks

uweigand added a commit to uweigand/runtime that referenced this pull request Mar 7, 2023
Manual backport of dotnet#82429.
Replace darwin_change_default_file_handles by a new routine
increase_descriptor_limit, which mirrors the logic in the CoreCLR
INIT_IncreaseDescriptorLimit routine.
Fixesdotnet#82428.
uweigand added a commit to uweigand/runtime that referenced this pull request Mar 7, 2023
Manual backport of dotnet#82429.
Replace darwin_change_default_file_handles by a new routine
increase_descriptor_limit, which mirrors the logic in the CoreCLR
INIT_IncreaseDescriptorLimit routine.
Fixesdotnet#82428.
@uweigand

Copy link
Copy Markdown
ContributorAuthor

Looks like there are some merge conflicts, @uweigand would you mind preparing manual backports? thanks

Hi @akoeplinger, I've now created manual backports (linked above). Note that these omit the Alpine-related cmake changes, since in .NET 6 and .NET 7 there isn't any support for Alpine in the Mono makefiles yet. If this is ever backported, the -DDONT_SET_RLIMIT_NOFILE change would have to be added at that point as well (CC @ayakael).

@akoeplinger

Copy link
Copy Markdown
Member

Ok, thanks!

@ayakael

Copy link
Copy Markdown
Contributor

Noted! I would like to backport #76500, which would allow the alpine-related changes to be backported as well. Unfortunately, there is worry associated with backporting platform support. Would you like me to backport that PR + your changes?

@uweigand

Copy link
Copy Markdown
ContributorAuthor

Noted! I would like to backport #76500, which would allow the alpine-related changes to be backported as well. Unfortunately, there is worry associated with backporting platform support. Would you like me to backport that PR + your changes?

The backport question is not really for me to decide. I wouldn't mind that, but I can also understand the concerns with backporting large features. In the end, that's for the maintainers to decide ...

@ghostghost locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-meta-monocommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mono runtime does not raise open file limit on Linux

4 participants

@uweigand@akoeplinger@ayakael@marek-safar