Skip to content
Snippets Groups Projects
Commit c2ce30c2 authored by Mark A. Grondona's avatar Mark A. Grondona Committed by Morris Jette
Browse files

proctrack/cgroup: Move slurmstepd out of freezer cgroup before removal

In order to successfully remove the freezer cgroup at the end of
a job step, the slurmstepd process itself must first be moved
outside of the cgroup, or removal will always fail.

This fix moves the slurmstepd back to the root cgroup just
before the rmdir operations are attempted.
parent 506bad75
No related branches found
No related tags found
No related merge requests found
......@@ -270,10 +270,27 @@ bail:
return SLURM_ERROR;
}
static int _move_current_to_root_cgroup(xcgroup_ns_t *ns)
{
xcgroup_t cg;
if (xcgroup_create(ns, &cg, "", 0, 0) != XCGROUP_SUCCESS)
return SLURM_ERROR;
return xcgroup_move_process(&cg, getpid());
}
int _slurm_cgroup_destroy(void)
{
xcgroup_lock(&freezer_cg);
/*
* First move slurmstepd process to the root cgroup, otherwise
* the rmdir(2) triggered by the calls below will always fail,
* because slurmstepd is still in the cgroup!
*/
_move_current_to_root_cgroup(&freezer_ns);
if (jobstep_cgroup_path[0] != '\0') {
if (xcgroup_delete(&step_freezer_cg) != XCGROUP_SUCCESS) {
debug("_slurm_cgroup_destroy: problem deleting step cgroup path %s: %m",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment