diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-21 19:19:20 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-27 15:40:40 +0000 |
commit | ea79d98b4c3d859880d9e41633826b12f8339b2e (patch) | |
tree | 04a233bf8ae79052010a59402b59f7f89a886569 | |
parent | 3946c981d1f155631294bdeb07ae6aceb9a821f0 (diff) |
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
-rw-r--r-- | src/mcd-dispatch-operation.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c index 0bb05397..afe4cda3 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); } |