diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-02-04 07:05:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-04 07:05:32 +0800 |
commit | 0662384d294eaa44390799747db030e8d401111d (patch) | |
tree | 6bcad5a235b4208a74385466e519c0c6d90d9912 | |
parent | b4e05adcc7c40e7f77839bad350df625094940ed (diff) | |
parent | ec28a58cc1cc1671a09061d5aa24d1c4c9c77b9f (diff) | |
download | dexon-0662384d294eaa44390799747db030e8d401111d.tar dexon-0662384d294eaa44390799747db030e8d401111d.tar.gz dexon-0662384d294eaa44390799747db030e8d401111d.tar.bz2 dexon-0662384d294eaa44390799747db030e8d401111d.tar.lz dexon-0662384d294eaa44390799747db030e8d401111d.tar.xz dexon-0662384d294eaa44390799747db030e8d401111d.tar.zst dexon-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.go | 8 |
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 } |