Skip to content

Commit 3ad49a2

Browse files
authored
Merge pull request #3578 from sofat1989/containerd-stress
update the max if cur will be greater than max for setting the limit
2 parents 4a2f61c + 5cab0d3 commit 3ad49a2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cmd/containerd-stress/rlimit_unix.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func setRlimit() error {
3131
}
3232
if limit.Cur < rlimit {
3333
limit.Cur = rlimit
34+
if limit.Max < limit.Cur {
35+
limit.Max = limit.Cur
36+
}
3437
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
3538
return err
3639
}

0 commit comments

Comments
 (0)