Bug 53220

Summary: when racing to activate o.fd.T.MC5 and o.fd.T.AM, one or both fail
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: mission-controlAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Avoid race between Mission Control's two names by having one wait for the other

Description Simon McVittie 2012-08-07 18:59:16 UTC
Created attachment 65246 [details] [review]
Avoid race between Mission Control's two names by having one  wait for the other

If you do:

dbus-send --dest=org.freedesktop.Telepathy.MissionControl5 \
  --type=method_call --print-reply / org.freedesktop.DBus.Peer.Ping & \
dbus-send --dest=org.freedesktop.Telepathy.AccountManager \
--type=method_call --print-reply / org.freedesktop.DBus.Peer.Ping

then one or both of the calls will fail because the executable claims
one of its bus names, but can't get the other, and exits 1.

By making one wait for the other, we get the desired behaviour.
I've made activating MissionControl5 wait for AccountManager because
in MC's current implementation AccountManager is taken last (Bug #24000).
Comment 1 Simon McVittie 2012-08-07 19:02:04 UTC
(In reply to comment #0)
> If you do:
> 
> [some stuff with dbus-send]

Forgot to mention the prerequisite: MC is not already running.
Comment 2 Jonny Lamb 2012-08-08 08:18:12 UTC
Interesting! Your patch looks fine.
Comment 3 Simon McVittie 2012-08-08 09:42:30 UTC
Thanks, fixed in git for 5.12.2 and 5.13.1.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.