Skip to content

Commit 0662384

Browse files
authored
Merge pull request #16009 from holiman/db_handles
cmd/utils: fix #16006 by not lowering OS ulimit
2 parents b4e05ad + ec28a58 commit 0662384

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎cmd/utils/flags.go‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,13 +714,15 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
714714
// makeDatabaseHandles raises out the number of allowed file handles per process
715715
// for Geth and returns half of the allowance to assign to the database.
716716
func makeDatabaseHandles() int {
717-
if err := fdlimit.Raise(2048); err != nil {
718-
Fatalf("Failed to raise file descriptor allowance: %v", err)
719-
}
720717
limit, err := fdlimit.Current()
721718
if err != nil {
722719
Fatalf("Failed to retrieve file descriptor allowance: %v", err)
723720
}
721+
if limit < 2048 {
722+
if err := fdlimit.Raise(2048); err != nil {
723+
Fatalf("Failed to raise file descriptor allowance: %v", err)
724+
}
725+
}
724726
if limit > 2048 { // cap database file descriptors even if more is available
725727
limit = 2048
726728
}

0 commit comments

Comments
 (0)