Make GOMAXPROCS to be CPU limit aware

Fixes #10950
This commit is contained in:
Benjamin Elder 2023-05-18 10:32:49 -07:00 committed by GitHub
parent 7c647bcaeb
commit 008170c8a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -28,6 +28,8 @@ import (
jww "github.com/spf13/jwalterweatherman"
"go.uber.org/automaxprocs/maxprocs"
"github.com/bep/clock"
"github.com/bep/lazycache"
"github.com/bep/overlayfs"
@ -53,6 +55,8 @@ var (
// Execute executes a command.
func Execute(args []string) error {
// Default GOMAXPROCS to be CPU limit aware, still respecting GOMAXPROCS env.
maxprocs.Set()
x, err := newExec()
if err != nil {
return err