Skip to content

Commit 0bdf253

Browse files
authored
Merge pull request #525 from aledbf/fix-negative-maxopenfiles
Avoid negative values configuring the max number of open files
2 parents 4ecb905 + cf82f69 commit 0bdf253

File tree

1 file changed

+4
-0
lines changed
  • controllers/nginx/pkg/cmd/controller

1 file changed

+4
-0
lines changed

controllers/nginx/pkg/cmd/controller/nginx.go

+4
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) ([]byte, er
370370
wp = 1
371371
}
372372
maxOpenFiles := (sysctlFSFileMax() / wp) - 1024
373+
if maxOpenFiles < 0 {
374+
// this means the value of RLIMIT_NOFILE is too low.
375+
maxOpenFiles = 1024
376+
}
373377

374378
setHeaders := map[string]string{}
375379
if cfg.ProxySetHeaders != "" {

0 commit comments

Comments
 (0)