[next] telepathy-mission-control: McdDispatchOperation: don' t run approvers if we already have a result

Simon McVittie smcv at kemper.freedesktop.org
Thu Apr 3 07:28:04 PDT 2014


Module: telepathy-mission-control
Branch: next
Commit: ea79d98b4c3d859880d9e41633826b12f8339b2e
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=ea79d98b4c3d859880d9e41633826b12f8339b2e

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Mar 21 19:19:20 2014 +0000

McdDispatchOperation: don't run approvers if we already have a result

It seems that under GDBus' changed timing, we can have this
sequence of events:

* decide that we're ready to run approvers, scheduling it to happen
  in a high-priority idle
* receive and process the Claim method call, which finishes the
  dispatch operation
* run the idle

---

 src/mcd-dispatch-operation.c |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 0bb0539..afe4cda 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -417,6 +417,15 @@ _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self)
         self->priv->did_post_observer_actions = TRUE;
     }
 
+    /* if a handler has claimed or accepted the channel, we have nothing to
+     * do */
+    if (self->priv->result != NULL)
+    {
+        DEBUG ("already finished (or finishing): %s",
+               self->priv->result->message);
+        return;
+    }
+
     /* If nobody is bypassing approval, then we want to run approvers as soon
      * as possible, without waiting for observers, to improve responsiveness.
      * (The regression test dispatcher/exploding-bundles.py asserts that we
@@ -461,15 +470,6 @@ _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self)
         return;
     }
 
-    /* if a handler has claimed or accepted the channel, we have nothing to
-     * do */
-    if (self->priv->result != NULL)
-    {
-        DEBUG ("already finished (or finishing): %s",
-               self->priv->result->message);
-        return;
-    }
-
     /* If we're only meant to be observing, do nothing */
     if (self->priv->observe_only)
     {
@@ -2124,7 +2124,8 @@ mcd_dispatch_operation_idle_run_approvers (gpointer p)
 
     if (_mcd_dispatch_operation_needs_approval (self))
     {
-        if (!_mcd_dispatch_operation_is_approved (self))
+        if (self->priv->result == NULL &&
+            !_mcd_dispatch_operation_is_approved (self))
             _mcd_dispatch_operation_run_approvers (self);
     }
 



More information about the telepathy-commits mailing list