dbus exit on disconnect and glib

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Feb 21 05:08:20 PST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 21 Feb 2008 at 12:24:10 +0100, Frédéric Dalleau wrote:
> I've found my software using dbus (and dbus-glib) exits under some 
> conditions. Using dbus_set_exit_on_disconnect makes it not to exit, but 
> it still receives the "destroy" signal and then the proxy is invalid.
> 
> It uses a dbus_g_proxy with a well know name, so it should not receive 
> "destroy" signal.
> 
> Is someone aware of other possible disconnection causes for this code?

The exit behaviour controlled by dbus_set_exit_on_disconnect() does not apply
to other processes falling off the bus (the usual reason for the destroy
signal), but only to *your* application being disconnected from the bus daemon.

If this occurs, it's up to you how you handle disconnection, but if you manage
to reconnect, you will probably have missed signals (you certainly can't
guarantee to have seen them all), and you will have to do some sort of
application-specific resynchronization (re-downloading the current state
of remote objects you're interested in, setting up all your signal match
rules again, that sort of thing).

This is Havoc's rationale (which, FWIW, I don't agree with) for making libdbus
exit your process on disconnections - if you have written the necessary code
to handle disconnections gracefully, then you can safely disable the automatic
disconnections.

    Simon
-----BEGIN PGP SIGNATURE-----

iD8DBQFHvXfEWSc8zVUw7HYRAl7sAJ4y3jxCp/RfxViOjpmTMaUpI0266ACfeWgo
R+PiEZqepU/nqaGw6on/8tY=
=q9LO
-----END PGP SIGNATURE-----


More information about the dbus mailing list