Public bug reported:

[Impact]
When a process is assigned to a new cgroup systemd first saves the PID of the 
process then enqueues the job start for the new cgroup and finally assigns the 
process to the cgroup after it was created.

This multiple step process can generate race condition if systemd is
restarted (or daemon-reload happens) after the PID has been saved but
before the cgroup has been created. When systemd restarts it loses the
PID assignment to the cgroup and later deletes the empty cgroup.

[Test Plan] 
TODO

[Where problems could occur] 
This should fix the mentioned race condition. I don't think anyone would be 
expecting the previous behavior because it is non deterministic.

[Other Info]
This patch is available from systemd 247 so it is fixed in jammy and further 
versions.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: systemd (Ubuntu Focal)
     Importance: Undecided
     Assignee: Jorge Merlino (jorge-merlino)
         Status: Won't Fix

** Also affects: systemd (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Changed in: systemd (Ubuntu Focal)
       Status: New => Won't Fix

** Changed in: systemd (Ubuntu Focal)
     Assignee: (unassigned) => Jorge Merlino (jorge-merlino)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2162006

Title:
  Fix race condition when systemd is restarted while assigning processes
  to cgroups

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2162006/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to