You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Increase file descriptor limit in NativeAOT app process #82719
CoreCLR and soon Mono (after #82429) call a function that will increase the maximum open file descriptors via a function like this, should NativeAOT do the same?
It probably makes sense, just for parity purposes.
I am curious - are there specific reasons for this in CoreCLR/Mono or is it "just in case"? Any interesting history for why the call was introduced?
I don't know about the historical context (the function was already part of the initial CoreCLR github commit) but we recently saw issues if this isn't done during NuGet restore: #82428
Given we're seeing #82428 when the limit is not increased I think it still makes sense to have it, though you could argue that with NativeAOT in library mode maybe the embedding application should have the final say.
changed the title [-]Investigate whether to increase file descriptor limit in NativeAOT process[/-][+]Increase file descriptor limit in NativeAOT app process[/+]on Mar 1, 2023
Activity
VSadov commentedon Feb 27, 2023
It probably makes sense, just for parity purposes.
I am curious - are there specific reasons for this in CoreCLR/Mono or is it "just in case"? Any interesting history for why the call was introduced?
jkotas commentedon Feb 27, 2023
FWIW, this is disabled on Alpine and nobody ever complained about it there:
runtime/src/coreclr/pal/src/CMakeLists.txt
Lines 95 to 96 in e9b9489
akoeplinger commentedon Feb 27, 2023
I don't know about the historical context (the function was already part of the initial CoreCLR github commit) but we recently saw issues if this isn't done during NuGet restore: #82428
jkotas commentedon Feb 27, 2023
This was part of the original Rotor PAL: https://github.com/SSCLI/sscli_20021101/blob/77d46e0f04f52052a12ac40ce2cf96712c934b3c/pal/unix/init/pal.c#L629 .
VSadov commentedon Feb 27, 2023
I remember there was a bug fix for when we could temporarily have too many fd's. I'll try finding details.
VSadov commentedon Feb 27, 2023
Maybe it was to compensate for #47859 ?
(Assembly.Load opens /dev/zero in linux and does not close it)
It was fixed in #48140
VSadov commentedon Feb 27, 2023
At the time of Rotor using /dev/zero for anonymous memory mapping was likely the "right" way.
akoeplinger commentedon Feb 27, 2023
Given we're seeing #82428 when the limit is not increased I think it still makes sense to have it, though you could argue that with NativeAOT in library mode maybe the embedding application should have the final say.
VSadov commentedon Feb 27, 2023
The scenario with NuGet looks real. The app has a scenario that may open 1K+ files and gets away with that on CorCLR, making this a compat issue.
I think we should increase the limit on NativeAOT and perhaps on Alpine too, unless the reason (debugging is broken) is still there.
VSadov commentedon Feb 27, 2023
No compat concerns in this case.
It might be strange if library does this, especially if dynamically loaded.
agocke commentedon Feb 27, 2023
It seems reasonable to match the CoreCLR behavior here.
[-]Investigate whether to increase file descriptor limit in NativeAOT process[/-][+]Increase file descriptor limit in NativeAOT app process[/+]Add file handle limit setting for Alpine
Add file handle limit setting for Alpine (#94439)
Increase file descriptor limit in native AOT executables
Increase file descriptor limit in native AOT executables (dotnet#118995)