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

common/fdlimit: Move fdlimit files to separate package #15850

Merged

Conversation

ricardohsd
Copy link
Contributor

When go-ethereum is used as a library the calling program need to set the FD limit.

This commit extract fdlimit files to a separate package so it can be used outside of go-ethereum.

#15833

When go-ethereum is used as a library the calling program need to set
the FD limit.

This commit extract fdlimit files to a separate package so it can be
used outside of go-ethereum.
// to the maximum hard-limit allowed by the OS.
func raiseFdLimit(max uint64) error {
func RaiseFdLimit(max uint64) error {
Copy link
Contributor

@fjl fjl Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the functions so FdLimit doesn't appear in the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fjl thanks for the feedback. I tried to find better names than Raise, Get and GetMax but couldn't come up with something better.

Any suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ricardohsd You could use Current and Maximum. Then you would have:

fdlimit.Raise, fdlimit.Current and fdlimit.Maximum.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karalabe thanks!

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will merge if CI's green

@karalabe karalabe added this to the 1.8.0 milestone Jan 11, 2018
@karalabe karalabe merged commit 56152b3 into ethereum:master Jan 11, 2018
@ricardohsd ricardohsd deleted the move-fdlimits-to-separate-package branch April 7, 2018 16:42
mariameda pushed a commit to NiluPlatform/go-nilu that referenced this pull request Aug 23, 2018
* common/fdlimit: Move fdlimit files to separate package

When go-ethereum is used as a library the calling program need to set
the FD limit.

This commit extract fdlimit files to a separate package so it can be
used outside of go-ethereum.

* common/fdlimit: Remove FdLimit from functions signature

* common/fdlimit: Rename fdlimit functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants