GNOME Bugzilla – Bug 753278
gdbus: Don't use g_assert_no_error() GDBusObjectManagerServer
Last modified: 2017-11-03 16:03:47 UTC
There are real world cases where emitting signals can fail, such as if the DBus connection closes. Asserting and aborting the process in these cases is just plain lazy. Ignore the errors when the connection is closed, and turn the others into warnings.
This happened in Cockpit by the way. Found during testing, but likely also shows up in the real world.
Created attachment 308783 [details] [review] gdbus: Don't use g_assert_no_error() GDBusObjectManagerServer There are real world cases where emitting signals can fail, such as if the DBus connection closes. Asserting and aborting the process in these cases is just plain lazy. Ignore the errors when the connection is closed, and turn the others into warnings.
Review of attachment 308783 [details] [review]: I agree
Review of attachment 308783 [details] [review]: ::: gio/gdbusobjectmanagerserver.c @@ +969,3 @@ + if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED)) + { + g_warning ("Couldn't emit InterfacesAdded signal: %s", error->message); s/Added/Removed/
Merged with Marius' typo fix. Attachment 308783 [details] pushed as b3fcb14 - gdbus: Don't use g_assert_no_error() GDBusObjectManagerServer
If error is set and it *is* G_IO_ERROR_CLOSED, then the GError is leaked.
please always reopen
Thanks for fixing that.
*** Bug 680533 has been marked as a duplicate of this bug. ***
*** Bug 730388 has been marked as a duplicate of this bug. ***