Skip to content

exec2 driver: GOMAXPROCS auto-detection fails in Go 1.25 due to cgroup namespacing #82

Description

@aditi502

When using the exec2 driver with Go 1.25+ services, the Go runtime fails to auto-detect cgroup CPU quotas, defaulting instead to the total host core count. This occurs even when /sys/fs/cgroup and /proc are unveiled.

Observed Behavior
In Go 1.25, the runtime natively attempts to discover CPU limits via cgroup v2. However, inside an exec2 task, the process is placed in a new cgroup namespace.

/proc/self/cgroup reports the process is at the cgroup root (0::/).

Go runtime is not picking up the allocation's actual slice limit (nomad.slice/alloc-.../cpu.max), it defaults to the number of host cores causing overthreading.

Nomad v1.10.4
Go 1.25

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghcc/jira

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions