core: do not GC units/jobs that are in the D-Bus queue
Let's make sure that D-Bus messages are always sent out when pending,
before we might GC a unit/job.
This is kinda a follow-up for 8db998981a,
and a similar logic really applies: GC should only be done if we
processed everything else, generated evertyhing else and really don't
need it anymore.
This commit is contained in:
@@ -447,6 +447,10 @@ bool unit_may_gc(Unit *u) {
|
||||
if (u->in_cgroup_empty_queue || u->in_cgroup_oom_queue)
|
||||
return false;
|
||||
|
||||
/* Make sure to send out D-Bus events before we unload the unit */
|
||||
if (u->in_dbus_queue)
|
||||
return false;
|
||||
|
||||
if (sd_bus_track_count(u->bus_track) > 0)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user