core: Don't GC unit if it is in cgroup_empty_queue
The gc_unit_queue is dispatched before the cgroup_empty_queue. Because of this, when we enter in on_cgroup_empty_event, the unit in cgroup_empty_queue may already have been freed and we don't clean up the corresponding cgroup. With this change, we prevent the unit from being garbage collected if it is in the cgroup_empty_queue.
This commit is contained in:
@@ -441,6 +441,9 @@ bool unit_may_gc(Unit *u) {
|
||||
if (u->perpetual)
|
||||
return false;
|
||||
|
||||
if (u->in_cgroup_empty_queue)
|
||||
return false;
|
||||
|
||||
if (sd_bus_track_count(u->bus_track) > 0)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user