gdbus-codegen: Mute/lighten "Error setting property 'xxx' on interface yyy..." runtime warning
The gdbus-codegen generates a code, which uses a g_warning()
when a call to set a property fails, like here:
static void
e_dbus_source_proxy_set_property_cb (GDBusProxy *proxy,
GAsyncResult *res,
gpointer user_data)
{
const _ExtendedGDBusPropertyInfo *info = user_data;
GError *error;
GVariant *_ret;
error = NULL;
_ret = g_dbus_proxy_call_finish (proxy, res, &error);
if (!_ret)
{
g_warning ("Error setting property '%s' on interface org.gnome.evolution.dataserver.Source: %s (%s, %d)",
info->parent_struct.name,
error->message, g_quark_to_string (error->domain), error->code);
g_error_free (error);
}
else
{
g_variant_unref (_ret);
}
}
as it's a g_warning()
, reaching it in a CI results in a test failure, even it happened at the very end, like here. As the log will vanish soon, it says at the end of the failed test:
# End of EBookClient tests
(evolution-addressbook-factory:785): libedbus-private-WARNING **: 08:58:51.784: Error setting property
'ConnectionStatus' on interface org.gnome.evolution.dataserver.Source: The connection is closed (g-io-error-quark, 18)
Bail out! libedbus-private-FATAL-WARNING: Error setting property 'ConnectionStatus' on interface
org.gnome.evolution.dataserver.Source: The connection is closed (g-io-error-quark, 18)
This property change is propagated from the client to the evolution-source-registry process (and back) using D-Bus. As these are piled in a GMainContext, they can be delivered/invoked after the connection for the corresponding ESource is closed. I see it from time to time in the CI.
I suggest to either not use g_warning() here (maybe generally in the code generated by the gdbus-codegen?), or at least name some errors, which are not a problem, like when the connection is closed. There cannot be done much about the failure anyway, when the connection is closed, the less by the user.