mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
**What does this PR do? Why is it needed?** This PR adds the `runtime` package and it's subpackages (except `runtime/logging`) to the log generation process. which means they get an additional `log.go` file with the package path as a field. **Other notes for review** - `runtime/logging` is an exception because adding it to the log gen process messes with the internals of the package, since it's handling the logging formats, etc... - to test this, you can look at the logs emitted from these packages before and after this PR. they will have a field `prefix` before this PR, and no `prefix` after. The most obvious one is the runtime (`registry`) package itself which usually emits a log at the start and end of beacon node. This is as part of my goal to remove all `prefix` logs and move them to the new `package_path` format.
25 lines
555 B
Go
25 lines
555 B
Go
package fdlimits
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/common/fdlimit"
|
|
)
|
|
|
|
// SetMaxFdLimits is a wrapper around a few go-ethereum methods to allow prysm to
|
|
// set its file descriptor limits at the maximum possible value.
|
|
func SetMaxFdLimits() error {
|
|
curr, err := fdlimit.Current()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
max, err := fdlimit.Maximum()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
raisedVal, err := fdlimit.Raise(uint64(max))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
log.Debugf("Updated file descriptor limit to %d from %d", raisedVal, curr)
|
|
return nil
|
|
}
|