Skip to content

Commit

Permalink
[core] Explicitly default to infinite cpu/mem resource limits
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Jun 9, 2023
1 parent 2312f39 commit 64abe75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/task/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"errors"
"fmt"
"io"
"math"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -1525,9 +1526,13 @@ func makeTaskForMesosResources(

if limits != nil && limits.Cpu > 0 {
mesosTaskInfo.Limits["cpus"] = *resources.NewCPUs(limits.Cpu).Resource.Scalar
} else {
mesosTaskInfo.Limits["cpus"] = mesos.Value_Scalar{Value: math.Inf(1)} // magic value for infinity
}
if limits != nil && limits.Memory > 0 {
mesosTaskInfo.Limits["mem"] = *resources.NewMemory(limits.Memory).Resource.Scalar
} else {
mesosTaskInfo.Limits["mem"] = mesos.Value_Scalar{Value: math.Inf(1)} // magic value for infinity
}

// We must run the executor with a special LD_LIBRARY_PATH because
Expand Down

0 comments on commit 64abe75

Please sign in to comment.