diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2014-10-23 16:51:41 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2014-10-24 19:24:32 +0200 |
commit | 4496b69e47eac8e4748fc3e452571b61498916f1 (patch) | |
tree | ea5299db484366a5caff3b6bbe639b480130ff47 | |
parent | b54030de222ff5d1cf5c6643cda38a8d1552dabf (diff) | |
download | NetworkManager-4496b69e47eac8e4748fc3e452571b61498916f1.tar.gz |
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.
-rw-r--r-- | libnm/nm-object.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |