Before all processes in the cgroup are killed, the builder process
is migrated to the parent group, because kill_and_wait() waits
for nothing because it will never kill its own process.
def stop(self):
if self.cgroup:
+ # Move the builder process out of the cgroup.
+ self.cgroup.migrate_task(self.cgroup.parent, os.getpid())
+
# Kill all still running processes in the cgroup.
self.cgroup.kill_and_wait()
# Remove cgroup and all parent cgroups if they are empty.
- self.cgroup.migrate_task(self.cgroup.root, os.getpid())
self.cgroup.destroy()
parent = self.cgroup.parent