Skip to content

Commit 64abe75

Browse files
committed
[core] Explicitly default to infinite cpu/mem resource limits
1 parent 2312f39 commit 64abe75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/task/scheduler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"errors"
3434
"fmt"
3535
"io"
36+
"math"
3637
"strconv"
3738
"strings"
3839
"sync"
@@ -1525,9 +1526,13 @@ func makeTaskForMesosResources(
15251526

15261527
if limits != nil && limits.Cpu > 0 {
15271528
mesosTaskInfo.Limits["cpus"] = *resources.NewCPUs(limits.Cpu).Resource.Scalar
1529+
} else {
1530+
mesosTaskInfo.Limits["cpus"] = mesos.Value_Scalar{Value: math.Inf(1)} // magic value for infinity
15281531
}
15291532
if limits != nil && limits.Memory > 0 {
15301533
mesosTaskInfo.Limits["mem"] = *resources.NewMemory(limits.Memory).Resource.Scalar
1534+
} else {
1535+
mesosTaskInfo.Limits["mem"] = mesos.Value_Scalar{Value: math.Inf(1)} // magic value for infinity
15311536
}
15321537

15331538
// We must run the executor with a special LD_LIBRARY_PATH because

0 commit comments

Comments
 (0)