Skip to content

Allow setting low NPROC in codejail-service #983

@timmc-edx

Description

@timmc-edx

We currently need to set a very high CODE_JAIL.limits.NPROC for codejail-service, in the area of 2000, otherwise the sudo -u sandbox ... call fails to fork. This is much higher than the limit we actually want to set for a sandbox.

It turns out the issue is that while the NPROC setting constrains only one process, all processes owned by the same UID contribute to the usage count. And Docker does not confine UIDs, just the mapping of usernames to UIDs. If codejail-service runs as the app user in the container with UID 1000, the rlimit system still sees all of the other processes owned by UID 1000 on the host as well, and there are hundreds or even thousands of those.

The best solution we have available is to assign app a UID that does not collide with anything on the host.

Implementation:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done - Long Term Storage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions