aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-02-04 07:05:32 +0800
committerGitHub <noreply@github.com>2018-02-04 07:05:32 +0800
commit0662384d294eaa44390799747db030e8d401111d (patch)
tree6bcad5a235b4208a74385466e519c0c6d90d9912
parentb4e05adcc7c40e7f77839bad350df625094940ed (diff)
parentec28a58cc1cc1671a09061d5aa24d1c4c9c77b9f (diff)
downloadgo-tangerine-0662384d294eaa44390799747db030e8d401111d.tar
go-tangerine-0662384d294eaa44390799747db030e8d401111d.tar.gz
go-tangerine-0662384d294eaa44390799747db030e8d401111d.tar.bz2
go-tangerine-0662384d294eaa44390799747db030e8d401111d.tar.lz
go-tangerine-0662384d294eaa44390799747db030e8d401111d.tar.xz
go-tangerine-0662384d294eaa44390799747db030e8d401111d.tar.zst
go-tangerine-0662384d294eaa44390799747db030e8d401111d.zip
Merge pull request #16009 from holiman/db_handles
cmd/utils: fix #16006 by not lowering OS ulimit
-rw-r--r--cmd/utils/flags.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 89d16b968..58bb95243 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -714,13 +714,15 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
// makeDatabaseHandles raises out the number of allowed file handles per process
// for Geth and returns half of the allowance to assign to the database.
func makeDatabaseHandles() int {
- if err := fdlimit.Raise(2048); err != nil {
- Fatalf("Failed to raise file descriptor allowance: %v", err)
- }
limit, err := fdlimit.Current()
if err != nil {
Fatalf("Failed to retrieve file descriptor allowance: %v", err)
}
+ if limit < 2048 {
+ if err := fdlimit.Raise(2048); err != nil {
+ Fatalf("Failed to raise file descriptor allowance: %v", err)
+ }
+ }
if limit > 2048 { // cap database file descriptors even if more is available
limit = 2048
}