Skip to content

Commit

Permalink
Merge pull request #3578 from sofat1989/containerd-stress
Browse files Browse the repository at this point in the history
update the max if cur will be greater than max for setting the limit
  • Loading branch information
estesp committed Aug 26, 2019
2 parents 4a2f61c + 5cab0d3 commit 3ad49a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/containerd-stress/rlimit_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func setRlimit() error {
}
if limit.Cur < rlimit {
limit.Cur = rlimit
if limit.Max < limit.Cur {
limit.Max = limit.Cur
}
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
return err
}
Expand Down

0 comments on commit 3ad49a2

Please sign in to comment.