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 688313 - Each DBus interface exporting plugin should claim its own name
Each DBus interface exporting plugin should claim its own name
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-14 12:22 UTC by Rui Matos
Modified: 2012-12-19 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Claim a well-known name on the bus (5.85 KB, patch)
2012-11-14 12:22 UTC, Rui Matos
needs-work Details | Review

Description Rui Matos 2012-11-14 12:22:29 UTC
I've noticed this with the power plugin in particular: gnome-shell's
power indicator uses a GDBusProxy to watch dbus properties exported
from the power plugin. When restarting g-s-d, those properties are not
updated because the watch is done on g-s-d's name but when that shows
up the power plugin interface hasn't been exported yet.

It seems to me that we need to either do this or have a signal on the
plugins so that they can tell the main g-s-d code when they're
finished initializing and have exported their DBus interfaces and only
then claim the name.
Comment 1 Rui Matos 2012-11-14 12:22:32 UTC
Created attachment 228960 [details] [review]
power: Claim a well-known name on the bus

By relying on the main gnome-settings-daemon bus name we have a race
condition in that the name is claimed before the plugins are loaded
and so any interfaces exported from plugins are not readily available
when the name shows up on the bus.
Comment 2 David Zeuthen (not reading bugmail) 2012-12-12 15:51:42 UTC
I think your patch would work. However I think it would be better if gnome-settings-daemon just waited claiming its well-known name ("org.gnome.SettingsDaemon") until all plugins are laoaded.
Comment 3 Rui Matos 2012-12-12 16:27:47 UTC
(In reply to comment #2)
> However I think it would be better if
> gnome-settings-daemon just waited claiming its well-known name
> ("org.gnome.SettingsDaemon") until all plugins are laoaded.

This still wouldn't help the case of disabling and enabling plugins, I think.

g-s-d's plugins are conceptually orthogonal to each other so I still think that claiming their own names would work best for this specific case.
Comment 4 Colin Walters 2012-12-12 22:43:44 UTC
See also:

http://lists.freedesktop.org/archives/dbus/2011-April/014299.html

My recommendation here is the same as comment 2 - claim the name late, and use some other mechanism for process exclusion.
Comment 5 Bastien Nocera 2012-12-19 11:00:21 UTC
Review of attachment 228960 [details] [review]:

This should be 3 separate patches. Why is the power plugin the only one monitoring the name ownership? Does it break gnome-settings-daemon's --replace?

What about the XRandR plugin?

I would also need a complete list of the impacted modules (and plugins within those modules if necessary).
Comment 6 Bastien Nocera 2012-12-19 16:20:32 UTC
Committed in a couple of separate patches, thanks for noticing.