[Pkg-telepathy-commits] [telepathy-mission-control-6] 48/90: McdDispatchOperation: don't run approvers if we already have a result

Simon McVittie smcv at debian.org
Wed May 14 12:09:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 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);
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list