GDBusProxy: g_dbus_proxy_new_sync() can block if given a well-known name (not unique name?)
Despite claiming to return immediately when G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
and G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS
flags are set.
Reproducer:
/usr/share/dbus-1/services/org.test.Test.service
:
[D-BUS Service]
Name=org.test.Test
Exec=/usr/bin/false
SystemdService=test.service
/usr/lib/systemd/user/test.service
:
[Service]
Type=dbus
ExecStart=/usr/bin/false
BusName=org.test.Test
C code:
GDBusConnection *connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
GDBusProxy *proxy = g_dbus_proxy_new_sync (connection,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
NULL,
"org.test.Test",
"/org/test/Test",
"org.test.Test",
NULL,
NULL);
Related discourse thread: https://discourse.gnome.org/t/g-dbus-proxy-new-sync-blocks-for-25-seconds-despite-claiming-to-return-immediately/17104
Related D-Bus issue: https://gitlab.freedesktop.org/dbus/dbus/-/issues/458
GLib 2.78.0