Skip to content

Commit

Permalink
fix maxprocs logger
Browse files Browse the repository at this point in the history
  • Loading branch information
asobrien committed Oct 28, 2021
1 parent 3b098ea commit 33b04da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion executor/cmd/executor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ func main() {
logger := logf.Log.WithName("entrypoint")

// Set runtime.GOMAXPROCS to respect container limits if the env var GOMAXPROCS is not set or is invalid, preventing CPU throttling.
undo, err := maxprocs.Set(maxprocs.Logger(logger.Info))
undo, err := maxprocs.Set(maxprocs.Logger(func(format string, a ...interface{}) {
logger.WithName("maxprocs").Info(fmt.Sprintf(format, a...))
}))
defer undo()
if err != nil {
logger.Error(err, "failed to set GOMAXPROCS")
Expand Down

0 comments on commit 33b04da

Please sign in to comment.