]> err.no Git - systemd/commitdiff
unit,job: when we suppress a D-Bus signal because nobody is listening, don't delay...
authorLennart Poettering <lennart@poettering.net>
Sun, 16 May 2010 01:57:07 +0000 (03:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 16 May 2010 01:57:07 +0000 (03:57 +0200)
dbus-job.c
dbus-unit.c
job.c
manager.c
unit.c

index f14f92f9aa07bda2cdd244f5b9a40716d5cec508..3a6e7159e9959edc41a9623d8ec2d4e90896245b 100644 (file)
@@ -152,8 +152,10 @@ void bus_job_send_change_signal(Job *j) {
         LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
         j->in_dbus_queue = false;
 
-        if (set_isempty(j->manager->subscribed))
+        if (set_isempty(j->manager->subscribed)) {
+                j->sent_dbus_new_signal = true;
                 return;
+        }
 
         if (!(p = job_dbus_path(j)))
                 goto oom;
index ccaaef99a2931db04348814274d29b3f7ae92cec..0c311ea1a71825f88e5bd3eb3e18d7df4bce4c0d 100644 (file)
@@ -348,8 +348,10 @@ void bus_unit_send_change_signal(Unit *u) {
         LIST_REMOVE(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
         u->meta.in_dbus_queue = false;
 
-        if (set_isempty(u->meta.manager->subscribed))
+        if (set_isempty(u->meta.manager->subscribed)) {
+                u->meta.sent_dbus_new_signal = true;
                 return;
+        }
 
         if (!(p = unit_dbus_path(u)))
                 goto oom;
diff --git a/job.c b/job.c
index 1d59bcb27f7d99504a3bfbfed9b305e0eca32214..887de92cadf88eb70033ff665e6be829b421b513 100644 (file)
--- a/job.c
+++ b/job.c
@@ -541,6 +541,11 @@ void job_add_to_dbus_queue(Job *j) {
         if (j->in_dbus_queue)
                 return;
 
+        if (set_isempty(j->manager->subscribed)) {
+                j->sent_dbus_new_signal = true;
+                return;
+        }
+
         LIST_PREPEND(Job, dbus_queue, j->manager->dbus_job_queue, j);
         j->in_dbus_queue = true;
 }
index 4cc7d30e24ef5732df9ad60822e6c11f9869aacf..767533484ea09bf4685ef33895368e14ef99d187 100644 (file)
--- a/manager.c
+++ b/manager.c
@@ -57,7 +57,7 @@
 #define GC_QUEUE_ENTRIES_MAX 16
 
 /* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */
-#define GC_QUEUE_USEC_MAX (5*USEC_PER_SEC)
+#define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC)
 
 static int enable_special_signals(Manager *m) {
         char fd;
diff --git a/unit.c b/unit.c
index 1757af317ddbf60c7ac869ca4bdc992ca94e3aee..ee0c120b24fe0eee8aba3ab7758427c936821c7b 100644 (file)
--- a/unit.c
+++ b/unit.c
@@ -272,9 +272,14 @@ void unit_add_to_dbus_queue(Unit *u) {
         assert(u);
         assert(u->meta.type != _UNIT_TYPE_INVALID);
 
-        if (u->meta.load_state == UNIT_STUB || u->meta.in_dbus_queue || set_isempty(u->meta.manager->subscribed))
+        if (u->meta.load_state == UNIT_STUB || u->meta.in_dbus_queue)
                 return;
 
+        if (set_isempty(u->meta.manager->subscribed)) {
+                u->meta.sent_dbus_new_signal = true;
+                return;
+        }
+
         LIST_PREPEND(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
         u->meta.in_dbus_queue = true;
 }