-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
server: handle new behavior of setrlimit on macOS #37705
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macOS's getrlimit can return a garbage hard limit for the number of open files--that is, a hard limit which is higher than what setrlimit(2) will accept. Since Go 1.12's syscall.Setrlimit actually delegates to the C library's setrlimit, rather than making a system call directly, Cockroach can fail to start because its call to syscall.Setrlimit now fails. This commit fixes the problem in two ways: 1. It prevents a failed setrlimit call from stopping the entire server startup process, unless the original rlimit is really beneath the minimum allowable rlimit. 2. It provides a macOS wrapper for syscall.Getrlimit that returns the actual hard limit, thus preventing the setrlimit call from failing in the first place. Fix cockroachdb#37685. Release note: None
bdarnell
approved these changes
May 21, 2019
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!
Reviewed 3 of 3 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained
bors r=bdarnell |
craig bot
pushed a commit
that referenced
this pull request
May 21, 2019
37582: sql: fix multiplication incorrect of float and interval r=mjibson a=hueypark Fixes #37540 Release note (bug fix): fix multiplication incorrect of float and interval 37705: server: handle new behavior of setrlimit on macOS r=bdarnell a=benesch macOS's getrlimit can return a garbage hard limit for the number of open files--that is, a hard limit which is higher than what setrlimit(2) will accept. Since Go 1.12's syscall.Setrlimit actually delegates to the C library's setrlimit, rather than making a system call directly, Cockroach can fail to start because its call to syscall.Setrlimit now fails. This commit fixes the problem in two ways: 1. It prevents a failed setrlimit call from stopping the entire server startup process, unless the original rlimit is really beneath the minimum allowable rlimit. 2. It provides a macOS wrapper for syscall.Getrlimit that returns the actual hard limit, thus preventing the setrlimit call from failing in the first place. Fix #37685. Release note: None Co-authored-by: Jaewan Park <jaewan.huey.park@gmail.com> Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Build succeeded |
zbeekman
added a commit
to Homebrew/formula-patches
that referenced
this pull request
May 22, 2019
- Issue with v19 & go 1.12 - `setrlimit` changed causing crash if `kern.maxfiles` is too low. - See cockroachdb/cockroach#37705
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
macOS's getrlimit can return a garbage hard limit for the number of open
files--that is, a hard limit which is higher than what setrlimit(2) will
accept. Since Go 1.12's syscall.Setrlimit actually delegates to the C
library's setrlimit, rather than making a system call directly,
Cockroach can fail to start because its call to syscall.Setrlimit now
fails.
This commit fixes the problem in two ways:
It prevents a failed setrlimit call from stopping the entire
server startup process, unless the original rlimit is really
beneath the minimum allowable rlimit.
It provides a macOS wrapper for syscall.Getrlimit that returns the
actual hard limit, thus preventing the setrlimit call from failing
in the first place.
Fix #37685.
Release note: None