common/fdlimit: Move fdlimit files to separate package (#15850)
* 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
This commit is contained in:
		
				
					committed by
					
						 Péter Szilágyi
						Péter Szilágyi
					
				
			
			
				
	
			
			
			
						parent
						
							023769d9d4
						
					
				
				
					commit
					56152b31ac
				
			| @@ -31,6 +31,7 @@ import ( | ||||
| 	"github.com/ethereum/go-ethereum/accounts" | ||||
| 	"github.com/ethereum/go-ethereum/accounts/keystore" | ||||
| 	"github.com/ethereum/go-ethereum/common" | ||||
| 	"github.com/ethereum/go-ethereum/common/fdlimit" | ||||
| 	"github.com/ethereum/go-ethereum/consensus" | ||||
| 	"github.com/ethereum/go-ethereum/consensus/clique" | ||||
| 	"github.com/ethereum/go-ethereum/consensus/ethash" | ||||
| @@ -721,10 +722,10 @@ 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 := raiseFdLimit(2048); err != nil { | ||||
| 	if err := fdlimit.Raise(2048); err != nil { | ||||
| 		Fatalf("Failed to raise file descriptor allowance: %v", err) | ||||
| 	} | ||||
| 	limit, err := getFdLimit() | ||||
| 	limit, err := fdlimit.Current() | ||||
| 	if err != nil { | ||||
| 		Fatalf("Failed to retrieve file descriptor allowance: %v", err) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user