aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-02-02 16:33:33 +0800
committerMartin Holst Swende <martin@swende.se>2018-02-02 16:33:33 +0800
commitec28a58cc1cc1671a09061d5aa24d1c4c9c77b9f (patch)
tree7136ff03bc4f4aaa4139b3e677186cdff08eb684 /cmd
parent4dedde7beb4518e191214702e92aa220159319e4 (diff)
downloadgo-tangerine-ec28a58cc1cc1671a09061d5aa24d1c4c9c77b9f.tar.gz
go-tangerine-ec28a58cc1cc1671a09061d5aa24d1c4c9c77b9f.tar.zst
go-tangerine-ec28a58cc1cc1671a09061d5aa24d1c4c9c77b9f.zip
utils: fix #16006 by not lowering OS ulimit
Diffstat (limited to 'cmd')
-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
}