GNOME Bugzilla – Bug 780405
main: Start the manager only after we're sure we own the DBus name
Last modified: 2017-03-22 18:21:26 UTC
This is the real culprit beyond bug 780362
Created attachment 348508 [details] [review] main: Start the manager only after we're sure we own the DBus name This closes a race where the clients we spawn wouldn't be able to reach us on the well known DBus name because they'd attempt to do so before we own it. By registering DBus APIs on the bus acquired callback but only starting the GsmManager on name acquired we guarantee that clients will be able to reach us.
Review of attachment 348508 [details] [review]: yup, looks right. One thing that's important is that we continue to register the manager object with the bus before we take the name, so there's never a point where we're on the bus but don't advertise e.g. /org/gnome/SessionManager It looks like we do continue to do that in on_bus_acquired as part of gsm_manager_new/register_manager so I think the way you split up on_bus_acquired and on_name_acquired is optimal.
Yes, I went through the GsmManager initialization steps to make sure we still register all of the DBus api before owning the name. Attachment 348508 [details] pushed as 076d2e7 - main: Start the manager only after we're sure we own the DBus name