Skip to content

Commit 5d1a455

Browse files
committed
fix(podman): pass bare RLIMIT type ("NOFILE") to specgen
Podman's addRlimits (pkg/specgen/generate/oci.go) prepends "RLIMIT_" to whatever Type we pass before handing the spec to runc. Setting Type="RLIMIT_NOFILE" yielded "RLIMIT_RLIMIT_NOFILE" in the final OCI bundle, which runc rejects with: runc create failed: wrong rlimit value: RLIMIT_RLIMIT_NOFILE Pass the bare suffix "NOFILE" so podman appends the prefix exactly once. Docker's path is unaffected — it uses units.Ulimit{Name: "nofile"}.
1 parent 62e6336 commit 5d1a455

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/podman/podman.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,14 @@ func (m *manager) CreateContainer(
254254

255255
// Bump RLIMIT_NOFILE to the kernel's hard ceiling so EL clients
256256
// don't trip "too many open files" errors during long benchmark
257-
// runs. Applied to every container we create.
257+
// runs. Applied to every container we create. Note: Podman's
258+
// addRlimits prepends "RLIMIT_" to whatever Type we pass, so the
259+
// value here must be the bare suffix ("NOFILE"), not the full
260+
// "RLIMIT_NOFILE" — passing the full form yields RLIMIT_RLIMIT_NOFILE
261+
// at the OCI runtime layer, which runc rejects.
258262
nofile := docker.HostMaxNofile()
259263
s.Rlimits = append(s.Rlimits, specs.POSIXRlimit{
260-
Type: "RLIMIT_NOFILE",
264+
Type: "NOFILE",
261265
Hard: nofile,
262266
Soft: nofile,
263267
})

0 commit comments

Comments
 (0)