-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: issues determining how many process threads can be created inside containers #72148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CC @golang/runtime |
Your RLIMIT_NPROCS seems high ( There is also a PID cgroup, which can limit the total number of PIDs (from the kernel's perspective this means total threads, not total processes). I'm not sure where podman mounts the cgroups, but threads like this one suggest you might find the limit at There should also be That thread also suggests you can try adjusting the limit with Can you check if this limit is the immediate cause of the failures? If so, I am curious what the limit is set to and how many cores your machine has? |
oooof, well this is embarrassing my apologies. While gathering the output for the pids-limit I realized the code path i was running wasn't properly setting --pids-limit to -1 for the root container, unlike the other code paths. apologies for the noise. |
Go version
go version go1.23.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I'm running a go generate command that invokes a program that executes a number of go build commands that generate wasi binaries. Outside of the container everything works well. There are no issues..
Golang's runtime seems to struggle a bit inside containers in general, I've seen issues with it not properly detecting the number of cores the container is allowed, etc. I mention this only because setting MAXGOPROCS for
go generate
to lower values effectively resolves the problem, but it less than ideal since it causes compilation to take longer.Go generate doesnt seem to be the issue, since running the command it invokes in isolation also has the issue. since the host isnt having issues with the command and the container is being provided access to the hosts entire resources, I wouldn't expect any issues.
So I'm left with a weird interaction between the go runtime and the container runtime (podman).
I can provide the container file, the container runtime (podman) and the commands need to reproduce the issue if needed.
I'm primarily interested in whats going on for future reference so I can put safeguards in place. I've run into a number of issues executing go tooling inside the containerized environments. this one is a fairly complicated environment involving nested containers. But I've had zero luck adjusting the user limits to resolve the issue and it happens even without nested containers.
What did you see happen?
Inside the container Ivery frequently, basically every attempt, get:
What did you expect to see?
I expected the same results as on the host.
The text was updated successfully, but these errors were encountered: