-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Raise Soft File Descriptor Limit Up To The Hard Limit #10650
Conversation
package fdlimits | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common/fdlimit" |
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.
I see no downside to doing this by default, so 👍. I looked at the go-ethereum lib because I was curious why we were adding this dependency on them. It looks like the benefit here is that they have the major os-specific variants set up with appropriate build tags, so that we can have this simple Raise(Maximum())
code (including eg Windows where the raise is a no-op). seems fine.
runtime/fdlimits/fdlimits_test.go
Outdated
|
||
func TestSetMaxFdLimits(t *testing.T) { | ||
var limit syscall.Rlimit | ||
assert.NoError(t, syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit)) |
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.
Will this break tests on Windows?
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.
This wouldnt work on windows admittedly. I can add in a check to only run this on linux/macos.
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.
Maybe the test could just be to call the method to Raise to the Max, then request Current and compare it to Max? That way the tests stick to the go-ethereum methods (assuming we implicitly trust that these methods are doing the correct thing on each platform).
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.
LGTM!
What type of PR is this?
Feature Addition
What does this PR do? Why is it needed?
Which issues(s) does this PR fix?
N.A
Other notes for review