summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-01-23 18:06:02 -0500
committerRyan Lortie <desrt@desrt.ca>2013-01-24 10:56:51 -0500
commit0b7fe6e2ac16f5cf99bee68ce2c82b13d5ed4fce (patch)
treebee7905f862bd8b9003bfd82a055b933de6c3b70
parent5d7da8c59b3d8bea0fe0214602306629f8df13a9 (diff)
downloaddconf-0b7fe6e2ac16f5cf99bee68ce2c82b13d5ed4fce.tar.gz
engine: accept out-of-order error reply messages
Due to a quirk of the implementation of the D-Bus daemon (see upstream bug https://bugs.freedesktop.org/show_bug.cgi?id=59780 for details) error messages can arrive out of sequence with repsect to the order of the method calls that they are in reply to. This may or may not be a violation of the strict-ordering principle of D-Bus (which does not actually appear to be written into the spec) but either way, we should dial down our assumptions about ordering since the D-Bus implementation that everyone is using does not currently work this way. https://bugzilla.gnome.org/show_bug.cgi?id=687120
-rw-r--r--engine/dconf-engine.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 30c4881..5a7b6ac 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -878,7 +878,6 @@ dconf_engine_change_completed (DConfEngine *engine,
const GError *error)
{
OutstandingChange *oc = handle;
- DConfChangeset *expected;
dconf_engine_lock_queues (engine);
@@ -888,9 +887,27 @@ dconf_engine_change_completed (DConfEngine *engine,
*
* The reply we just received should therefore be at the head of
* our 'in flight' queue.
+ *
+ * Due to https://bugs.freedesktop.org/show_bug.cgi?id=59780 it is
+ * possible that we receive an out-of-sequence error message, however,
+ * so only assume that messages are in-order for positive replies.
*/
- expected = g_queue_pop_head (&engine->in_flight);
- g_assert (expected && oc->change == expected);
+ if (reply)
+ {
+ DConfChangeset *expected;
+
+ expected = g_queue_pop_head (&engine->in_flight);
+ g_assert (expected && oc->change == expected);
+ }
+ else
+ {
+ gboolean found;
+
+ g_assert (error != NULL);
+
+ found = g_queue_remove (&engine->in_flight, oc->change);
+ g_assert (found);
+ }
/* We just popped a change from the in-flight queue, possibly
* making room for another to be added. Check that.