After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 749103 - gdbusproxy stops tracking if dbus service restarts
gdbusproxy stops tracking if dbus service restarts
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gdbus
2.34.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-05-08 11:45 UTC by andreas.robitzkat
Modified: 2018-05-24 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description andreas.robitzkat 2015-05-08 11:45:19 UTC
I created a DBus service and a client with glib (GDBUS).

To create an adaptor for the client I used the method:

mProxy = myService_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
            G_DBUS_PROXY_FLAGS_NONE, SERVICE_NAME,
            SERVICE_PATH,
            NULL, &mError);

As long as I understand this, basically a struct gets filled with the data I pass to the method (service-name, path, etc.). After that this creates a GDBusConnection which has the socket of the system bus as a property.

To call methods I use:

myService_call_myMethod_sync(mProxy, &res, NULL, &mError);

This works fine for my until my DBus service gets shut down during the client lifetime.

After that, the client requests are going into nowhere and the client isnt able to communicate with my dbus-service anymore. 
I get errors like:
GLib-GIO-CRITICAL **: g_dbus_proxy_call_sync_internal: as                                   sertion `error == NULL || *error == NULL' failed.
I think this is a bug, because normally the service should get started by the client if the name doesnt exist on the system bus.
To fix this I started to call the myService_dbus_adaptor_proxy_new_for_bus_sync-method in every client method with the exact same parameters. Now I can restart my dbus-service and the client is still able to communicate with it.

Why is it, that this GDBusProxy stops tracking if my DBus-service restarts? Like described above, my understanding is, that GDBusProxy is just a struct filled with data which remains the same. If no service with the specified name is running, my client should start the service. But that only works if I created a new proxy for that. Is this a bug?
Comment 1 Colin Walters 2015-05-08 13:02:26 UTC
You want to use `g_bus_watch_name()`.
Comment 2 GNOME Infrastructure Team 2018-05-24 17:50:00 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1036.