Bug 36199

Summary: Should prefer running handlers over not running ones
Product: Telepathy Reporter: Guillaume Desmottes <guillaume.desmottes>
Component: mission-controlAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED DUPLICATE QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Guillaume Desmottes 2011-04-13 00:58:46 UTC
Here is my life:
- I have Empathy 2.34 installed on my system. In 2.34 empathy-chat hasn't been
splitted yet, so the 'Empathy' process is still a text handler. As a result,
/usr/share/telepathy/clients/Empathy.client claims that Telepathy.Client.Empathy is a text
handler, which is true.

- But as I like to live on the bleeding edge, I usually run empathy master. So
I start manually empathy and empathy-chat. In master there is no
Telepathy.Client.Empathy any more, as text channels are now handled by
Telepathy.Client.Empathy.Chat.

- When I receive a new incoming text channel, MC usually try to dispatch it to
Telepathy.Client.Empathy first, which fails because I already have another
empathy running and then it starts dispatching to Empathy.Chat

I realise that my situation is a bit of a corner case, but I think MC should
prefer Client.Empathy.Chat as it's a as good handler as Client.Empathy and this
one is already running while Client.Empathy is not.


Here is the MC logs when receiving such channel:

mcd-DEBUG: 13/04/2011 09:45:08.531058: _mcd_mission_set_parent: child = 0x133e980, parent = 0x13a1100
mcd-DEBUG: 13/04/2011 09:45:08.531367: _mcd_dispatcher_take_channels: unrequested channel 0x133e980 (only): /org/freedesktop/Telepathy/Connection/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe_2fX200s/ImChannel13
mcd-DEBUG: 13/04/2011 09:45:08.531532: _mcd_dispatcher_take_channels: possible handlers found, dispatching
mcd-DEBUG: 13/04/2011 09:45:08.531655: _mcd_channel_set_status: 0x133e980, 3
mcd-DEBUG: 13/04/2011 09:45:08.531759: _mcd_dispatcher_enter_state_machine: CTXREF11 on 0x1496740
mcd-DEBUG: 13/04/2011 09:45:08.531857: _mcd_dispatcher_enter_state_machine: new dispatcher context 0x1496740 for unrequested channel 0x133e980 (only): /org/freedesktop/Telepathy/Connection/gabble/jabber/cassidy_40jabber_2ebelnet_2ebe_2fX200s/ImChannel13
mcd-DEBUG: 13/04/2011 09:45:08.532004: mcd_dispatch_operation_constructor: do26/0x13a2bd0: needs_approval=T
mcd-DEBUG: 13/04/2011 09:45:08.532161: _mcd_plugin_dispatch_operation_init: 0x1473090
mcd-DEBUG: 13/04/2011 09:45:08.532267: _mcd_plugin_dispatch_operation_new: 0x1473090 (for 0x13a2bd0)
mcd-DEBUG: 13/04/2011 09:45:08.532378: _mcd_dispatcher_enter_state_machine: entering state machine for context 0x1496740
mcd-DEBUG: 13/04/2011 09:45:08.532618: mcd_dispatcher_context_ref: CTXREF01 on 0x1496740 (ref = 1)
mcd-DEBUG: 13/04/2011 09:45:08.532718: _mcd_dispatch_operation_run_clients: do26 0x13a2bd0
mcd-DEBUG: 13/04/2011 09:45:08.532814: _mcd_dispatch_operation_handlers_can_bypass_observers: org.freedesktop.Telepathy.Client.Empathy has BypassObservers=F
mcd-DEBUG: 13/04/2011 09:45:08.532902: _mcd_dispatch_operation_run_clients: Running observers
mcd-DEBUG: 13/04/2011 09:45:08.533132: _mcd_dispatch_operation_inc_observers_pending: 0 -> 1
mcd-DEBUG: 13/04/2011 09:45:08.533235: _mcd_dispatch_operation_run_observers: calling ObserveChannels on org.freedesktop.Telepathy.Client.Logger for CDO 0x13a2bd0
mcd-DEBUG: 13/04/2011 09:45:08.533942: _mcd_dispatch_operation_inc_observers_pending: 1 -> 2
mcd-DEBUG: 13/04/2011 09:45:08.534048: _mcd_dispatch_operation_run_observers: calling ObserveChannels on org.freedesktop.Telepathy.Client.GnomeShell._3a1_2e2316.n0 for CDO 0x13a2bd0
mcd-DEBUG: 13/04/2011 09:45:08.534646: _mcd_dispatch_operation_run_clients: All necessary observers invoked
mcd-DEBUG: 13/04/2011 09:45:08.534740: _mcd_dispatch_operation_run_clients: Checking finished/locks
mcd-DEBUG: 13/04/2011 09:45:08.534840: _mcd_dispatch_operation_handlers_can_bypass_approval: org.freedesktop.Telepathy.Client.Empathy has BypassApproval=F
mcd-DEBUG: 13/04/2011 09:45:08.534934: mcd_dispatcher_context_unref: CTXREF01 on 0x1496740 (ref = 2)
mcd-DEBUG: 13/04/2011 09:45:08.535027: mcd_dispatcher_context_unref: CTXREF11 on 0x1496740 (ref = 1)
mcd-DEBUG: 13/04/2011 09:45:08.535116: mcd_dispatcher_context_unref: freeing the context 0x1496740
mcd-DEBUG: 13/04/2011 09:45:08.535233: _mcd_dispatch_operation_inc_ado_pending: 0 -> 1
mcd-DEBUG: 13/04/2011 09:45:08.535352: mcd_dbus_get_interfaces: called
mcd-DEBUG: 13/04/2011 09:45:08.535454: get_connection: called for do26
mcd-DEBUG: 13/04/2011 09:45:08.535553: get_possible_handlers: called for do26
mcd-DEBUG: 13/04/2011 09:45:08.535785: _mcd_dispatch_operation_run_approvers: Calling AddDispatchOperation on approver org.freedesktop.Telepathy.Client.Empathy.EventManager for CDO /org/freedesktop/Telepathy/DispatchOperation/do26 @ 0x13a2bd0
mcd-DEBUG: 13/04/2011 09:45:08.535886: _mcd_dispatch_operation_inc_ado_pending: 1 -> 2
mcd-DEBUG: 13/04/2011 09:45:08.539096: _mcd_dispatch_operation_dec_ado_pending: 2 -> 1
mcd-DEBUG: 13/04/2011 09:45:08.545000: on_channel_ready: channel 0x133e980 is ready
mcd-DEBUG: 13/04/2011 09:45:08.556262: dbusprop_get_all: org.freedesktop.Telepathy.ChannelDispatchOperation
mcd-DEBUG: 13/04/2011 09:45:08.556322: mcd_dbus_get_interfaces: called
mcd-DEBUG: 13/04/2011 09:45:08.556370: get_connection: called for do26
mcd-DEBUG: 13/04/2011 09:45:08.556418: get_channels: called for do26
mcd-DEBUG: 13/04/2011 09:45:08.556545: get_possible_handlers: called for do26
mcd-DEBUG: 13/04/2011 09:45:08.564663: add_dispatch_operation_cb: Approver /org/freedesktop/Telepathy/Client/Empathy/EventManager accepted AddDispatchOperation /org/freedesktop/Telepathy/DispatchOperation/do26 (0x13a2bd0)
mcd-DEBUG: 13/04/2011 09:45:08.564726: _mcd_dispatch_operation_dec_ado_pending: 1 -> 0
mcd-DEBUG: 13/04/2011 09:45:08.579492: observe_channels_cb: success from /org/freedesktop/Telepathy/Client/GnomeShell/_3a1_2e2316/n0
mcd-DEBUG: 13/04/2011 09:45:08.579555: _mcd_dispatch_operation_dec_observers_pending: 2 -> 1
mcd-DEBUG: 13/04/2011 09:45:08.609961: observe_channels_cb: success from /org/freedesktop/Telepathy/Client/Logger
mcd-DEBUG: 13/04/2011 09:45:08.610027: _mcd_dispatch_operation_dec_observers_pending: 1 -> 0
mcd-DEBUG: 13/04/2011 09:45:08.610069: _mcd_plugin_dispatch_operation_observers_finished: 0x1473090
mcd-DEBUG: 13/04/2011 09:45:08.610111: _mcd_dispatch_operation_check_client_locks: waiting for approval
mcd-DEBUG: 13/04/2011 09:45:15.909857: dispatch_operation_handle_with_time: do26/0x13a2bd0
mcd-DEBUG: 13/04/2011 09:45:15.909924: _mcd_dispatch_operation_check_client_locks: trying next handler
mcd-DEBUG: 13/04/2011 09:45:15.909969: _mcd_dispatch_operation_try_next_handler: Possible handler: org.freedesktop.Telepathy.Client.Empathy (still exists: Y, already failed: N)
mcd-DEBUG: 13/04/2011 09:45:15.910022: _mcd_client_proxy_handle_channels: calling HandleChannels on org.freedesktop.Telepathy.Client.Empathy
mcd-DEBUG: 13/04/2011 09:45:15.910130: _mcd_channel_set_status: 0x133e980, 4
mcd-DEBUG: 13/04/2011 09:45:15.992763: dbusprop_get_all: org.freedesktop.Telepathy.AccountManager
mcd-DEBUG: 13/04/2011 09:45:15.992820: get_valid_accounts: called
mcd-DEBUG: 13/04/2011 09:45:15.992893: get_invalid_accounts: called
mcd-DEBUG: 13/04/2011 09:45:15.992952: mcd_dbus_get_interfaces: called
mcd-DEBUG: 13/04/2011 09:45:40.928154: _mcd_dispatch_operation_handle_channels_cb: error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
mcd-DEBUG: 13/04/2011 09:45:40.928328: _mcd_dispatch_operation_check_client_locks: trying next handler
mcd-DEBUG: 13/04/2011 09:45:40.928433: _mcd_dispatch_operation_try_next_handler: Possible handler: org.freedesktop.Telepathy.Client.Empathy (still exists: Y, already failed: Y)
mcd-DEBUG: 13/04/2011 09:45:40.928534: _mcd_dispatch_operation_try_next_handler: Possible handler: org.freedesktop.Telepathy.Client.Empathy.Chat (still exists: Y, already failed: N)
mcd-DEBUG: 13/04/2011 09:45:40.928647: _mcd_client_proxy_handle_channels: calling HandleChannels on org.freedesktop.Telepathy.Client.Empathy.Chat
mcd-DEBUG: 13/04/2011 09:45:40.928889: _mcd_channel_set_status: 0x133e980, 4
mcd-DEBUG: 13/04/2011 09:45:40.946080: _mcd_channel_set_status: 0x133e980, 5
mcd-DEBUG: 13/04/2011 09:45:40.946202: _mcd_dispatch_operation_finish: Result: Channel successfully handled by org.freedesktop.Telepathy.Client.Empathy.Chat
mcd-DEBUG: 13/04/2011 09:45:40.946247: _mcd_dispatch_operation_finish: successful HandleWith, channel went to org.freedesktop.Telepathy.Client.Empathy.Chat
mcd-DEBUG: 13/04/2011 09:45:40.946296: _mcd_dispatch_operation_finish: do26/0x13a2bd0 has finished
mcd-DEBUG: 13/04/2011 09:45:40.946337: mcd_dispatch_operation_actually_finish: do26/0x13a2bd0: finished
mcd-DEBUG: 13/04/2011 09:45:40.946397: _mcd_dispatch_operation_check_client_locks: waiting for HandleChannels to return
mcd-DEBUG: 13/04/2011 09:45:40.946438: _mcd_dispatch_operation_check_client_locks: already finished (or finishing): Channel successfully handled by org.freedesktop.Telepathy.Client.Empathy.Chat
mcd-DEBUG: 13/04/2011 09:45:40.946481: plugin_do_finalize: 0x1473090
Comment 1 Simon McVittie 2011-04-13 03:23:57 UTC

*** This bug has been marked as a duplicate of bug 21178 ***

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.