Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2020
Merged

Conversation

rwy7
Copy link
Contributor

@rwy7 rwy7 commented Apr 22, 2020

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

@rwy7
Copy link
Contributor Author

rwy7 commented Apr 22, 2020

@genie-omr build all

@rwy7
Copy link
Contributor Author

rwy7 commented Apr 22, 2020

@genie-omr build all

@rwy7 rwy7 force-pushed the fd-lim-osx branch 3 times, most recently from f04c72f to c332c87 Compare April 23, 2020 19:10
@rwy7 rwy7 marked this pull request as ready for review April 23, 2020 19:15
@rwy7
Copy link
Contributor Author

rwy7 commented Apr 23, 2020

@genie-omr build all

@fjeremic
Copy link
Contributor

Does this fix #4990?

@rwy7
Copy link
Contributor Author

rwy7 commented Apr 23, 2020

Yep, I just edited the top comment to reflect that fact.

Copy link
Contributor

@fjeremic fjeremic left a 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.

port/unix/omrsysinfo.c Outdated Show resolved Hide resolved
port/unix/omrsysinfo.c Outdated Show resolved Hide resolved
port/unix/omrsysinfo.c Outdated Show resolved Hide resolved
port/unix/omrsysinfo.c Outdated Show resolved Hide resolved
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>
@rwy7
Copy link
Contributor Author

rwy7 commented Apr 24, 2020

I've addressed Keith's comments (thanks for the review!).
@genie-omr build all

@fjeremic fjeremic self-assigned this Apr 24, 2020
@fjeremic
Copy link
Contributor

I'll wait for an approval from either Keith or Andrew and this should be good to go.

@fjeremic fjeremic merged commit 2ddfbb5 into eclipse-omr:master Apr 24, 2020
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.

Fix omrsysinfo_get_limit/omrsysinfo_set_limit API reporting of hard limits on macOS
3 participants