ignore unique-name dbus connections
Processes which only expose unique-name connections are dbus-clients
and do not need to have their dbus tree interrogated. It is also
common practice for a daemon to create a bus connection, create their
objects, and then claim a well-known name. By having objmgr look at
the unique-name connections from those daemons, objmgr is getting
too early a look into the daemon.
Filter out the unique-name connections from the dbus signal match.
I ran this on Bletchley hardware and observed a small boot time
performance gain (<1s) which was difficult to distinguish from
noise. On some machines with heavy script-driven `busctl` operations,
this was reported to have some noticeable performance benefit.
Tested: Ran on Bletchley and observed no change in behavior for
mapper-wait, entity-manager, etc.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I93bde89409f049682fb7c67ab1fe45b7b9cf795a
diff --git a/src/main.cpp b/src/main.cpp
index 2f5e7f9..c309d87 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -669,6 +669,12 @@
message.read(name, oldOwner, newOwner);
+ if (name.starts_with(':'))
+ {
+ // We should do nothing with unique-name connections.
+ return;
+ }
+
if (!oldOwner.empty())
{
processNameChangeDelete(nameOwners, name, oldOwner,