-
Notifications
You must be signed in to change notification settings - Fork 398
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
Fix max open file limits on OSX #5108
Conversation
@genie-omr build all |
@genie-omr build all |
f04c72f
to
c332c87
Compare
@genie-omr build all |
Does this fix #4990? |
Yep, I just edited the top comment to reflect that fact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for fixing this! Suggesting @youngar / @keithc-ca to have another look as a port library experts.
on OSX, there are two mechanisms for reporting the limits of the system. The first is getrlimit/setrlimit, and the second is through sysctl. Sysctl will report the maximum number of open files that the kernel will allow a process to have. This is a global property that affects all processes. getrlimit/setrlimit, on the other hand, will report the limits set on a given process. These two limits do not have to match. The true soft limit for open files is the minimum between the current rlimit and the sysctl limit. The true hard limit is the minimum between the max rlimit and the sysctl limit. With this PR, this is what we report and enforce on OSX. Signed-off-by: Robert Young <rwy0717@gmail.com>
I've addressed Keith's comments (thanks for the review!). |
I'll wait for an approval from either Keith or Andrew and this should be good to go. |
on OSX, there are two mechanisms for reporting the limits of the system.
The first is getrlimit/setrlimit, and the second is through sysctl.
Sysctl will report the maximum number of open files that the kernel will
allow a process to have. This is a global property that affects all
processes.
getrlimit/setrlimit, on the other hand, will report the limits set on a
given process.
These two limits do not have to match.
The true soft limit for open files is the minimum between the current
rlimit and the sysctl limit. The true hard limit is the minimum between
the max rlimit and the sysctl limit.
With this PR, this is what we report and enforce on OSX.
Fixes: #4990
Signed-off-by: Robert Young rwy0717@gmail.com