-
Notifications
You must be signed in to change notification settings - Fork 2k
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
client: refactor cpuset manager initialization #14230
Conversation
cf2a951
to
16a1b61
Compare
16a1b61
to
da17f3f
Compare
da17f3f
to
209caa4
Compare
209caa4
to
42f5684
Compare
42f5684
to
21b0614
Compare
21b0614
to
fe53ed2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. Do you think it needs a CHANGELOG entry?
ahh I dunno how I keep forgetting these! I'll add one |
This PR refactors the code path in Client startup for setting up the cpuset cgroup manager (non-linux systems not affected). Before, there was a logic bug where we would try to read the cpuset.cpus.effective cgroup interface file before ensuring nomad's parent cgroup existed. Therefor that file would not exist, and the list of useable cpus would be empty. Tasks started thereafter would not have a value set for their cpuset.cpus. The refactoring fixes some less than ideal coding style. Instead we now bootstrap each cpuset manager type (v1/v2) within its own constructor. If something goes awry during bootstrap (e.g. cgroups not enabled), the constructor returns the noop implementation and logs a warning. Fixes #14229
fe53ed2
to
13bd08b
Compare
client: refactor cpuset manager initialization
client: refactor cpuset manager initialization Co-authored-by: Seth Hoenig <[email protected]>
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR refactors the code path in Client startup for setting up the cpuset
cgroup manager (non-linux systems not affected).
Before, there was a logic bug where we would try to read the
cpuset.cpus.effective
cgroup interface file before ensuring nomad's parent cgroup existed. Therefore on first run that
file would not exist, and the list of usable cpus would be empty. Tasks started
thereafter would not have a value set for their
cpuset.cpus
file.The refactoring fixes some hard to parse init code. Instead we now bootstrap
each cpuset manager type (v1/v2) within its own constructor. If something goes
awry during bootstrap (e.g. cgroups not enabled), the constructor returns the
noop implementation and logs a warning.
Fixes #14229
Only 1.3.x and higher, when cgroup v2 support was added