]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: don't bother enqueuing signal messages into busses that aren't ready yet
authorLennart Poettering <lennart@poettering.net>
Tue, 13 Feb 2018 17:27:47 +0000 (18:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Feb 2018 18:54:29 +0000 (19:54 +0100)
This is an optimization: there's no point in enqueuing unit and job
change notificiation signal messages into bus connection that aren't
fully set up yet.

This doesn't fix #8166 but should lower the load of messages enqueued
but not processed yet a bit.

src/core/dbus.c

index 305824da9b073722b7bb1f7a49d7ac471edb62a3..d023c8715c2893142bfd985d65aa646333cea588 100644 (file)
@@ -1197,6 +1197,11 @@ int bus_foreach_bus(
 
         /* Send to all direct buses, unconditionally */
         SET_FOREACH(b, m->private_buses, i) {
+
+                /* Don't bother with enqueing these messages to clients that haven't started yet */
+                if (sd_bus_is_ready(b) <= 0)
+                        continue;
+
                 r = send_message(b, userdata);
                 if (r < 0)
                         ret = r;