core: Make sure cgroup_oom_queue is flushed on manager exit
authorMichal Koutný <mkoutny@suse.com>
Wed, 4 Aug 2021 16:59:35 +0000 (18:59 +0200)
committerDan Streetman <ddstreet@canonical.com>
Thu, 5 Aug 2021 14:35:20 +0000 (10:35 -0400)
commit13e721036bf4ba15eb255d8f0a14800f969ac0d7
treeedd5b61c3679d910f642dd91a6c9896118eacd7e
parent869f52f21831b611160c4937bef822ca94c802ba
core: Make sure cgroup_oom_queue is flushed on manager exit

The unit queues are not serialized/deserialized (they are recreated
after reexec/reload instead). The destroyed units are not removed from
the cgroup_oom_queue. That means the queue may contain possibly invalid
pointers to released units.

Fix this by removing the units from cgroup_oom_queue as we do for
others. When at it, sync assert checks with currently existing queues
and put them in order in the manager cleanup code.
src/core/manager.c
src/core/unit.c