From 4496b69e47eac8e4748fc3e452571b61498916f1 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 23 Oct 2014 16:51:41 +0200 Subject: [PATCH] libnm: Ignore NoReply errors when NM has vanished from the bus This fixes the /libnm/client-nm-running test failure when a race condition is hit: test-nm-client:10350): libnm-WARNING **: updated_properties: error reading NMRemoteSettings properties: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) What actually happens is that nm_running_changed_cb() calls GetAll() for a NMRemoteSettings object when NM appears on the bus. If it disappears shortly afterwards, another nm_running_changed_cb() is called which suppresses further object updates, but the original GetAll() might not have finished yet and DBus will generate a NoReply() response for it. We ought to ignore it. --- libnm/nm-object.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnm/nm-object.c b/libnm/nm-object.c index 0e82861fc4..3a95252ead 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -1632,11 +1632,17 @@ _nm_object_reload_properties_async (NMObject *object, GAsyncReadyCallback callba gboolean _nm_object_reload_properties_finish (NMObject *object, GAsyncResult *result, GError **error) { + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); GSimpleAsyncResult *simple; g_return_val_if_fail (NM_IS_OBJECT (object), FALSE); g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (object), _nm_object_reload_properties_async), FALSE); + /* NM might have disappeared meanwhile. That would cause a NoReply error to be emitted, + * but we don't care if property updates were disabled. */ + if (priv->suppress_property_updates) + return TRUE; + simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) return FALSE;