summaryrefslogtreecommitdiffstats
path: root/commands/commandeer.go
diff options
context:
space:
mode:
authorBenjamin Elder <bentheelder@google.com>2023-05-18 10:32:49 -0700
committerGitHub <noreply@github.com>2023-05-18 19:32:49 +0200
commit008170c8a9b90e8e5d403ca18d30e8c35ed4f961 (patch)
treecb74b6f9aa99af860c78a4ca5eb8d01fc317d094 /commands/commandeer.go
parent7c647bcaeba7a08955eb3a66a42cf673404731df (diff)
Make GOMAXPROCS to be CPU limit aware
Fixes #10950
Diffstat (limited to 'commands/commandeer.go')
-rw-r--r--commands/commandeer.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go
index 8e768f045..465516e2e 100644
--- a/commands/commandeer.go
+++ b/commands/commandeer.go
@@ -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