From: Lennart Poettering Date: Tue, 13 Feb 2018 17:27:47 +0000 (+0100) Subject: core: don't bother enqueuing signal messages into busses that aren't ready yet X-Git-Tag: v238~36^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9fc677e3c997548e701f418e0b413441e1c5e891;p=thirdparty%2Fsystemd.git core: don't bother enqueuing signal messages into busses that aren't ready yet 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. --- diff --git a/src/core/dbus.c b/src/core/dbus.c index 305824da9b0..d023c8715c2 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -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;