Summary: | MC crashes when GOA is restarted | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Guillaume Desmottes <guillaume.desmottes> |
Component: | mission-control | Assignee: | Telepathy bugs list <telepathy-bugs> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | major | ||
Priority: | medium | CC: | bigon |
Version: | unspecified | Keywords: | patch |
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
use G_STRFUNC in mission-control-plugins's DEBUG macro
mcd-account: add unregister_dbus_service() mcd-account: unregister the account once we're done deleting it mcd_account_delete: make sure that the account stays alive |
Description
Guillaume Desmottes
2014-06-09 09:29:06 UTC
Full logs when GOA is restarted: (process:13703): tp-glib/proxy-DEBUG: noc_idle_context_invoke: NameOwnerChanged(:1.310, -> :1.310) (process:13703): tp-glib/proxy-DEBUG: noc_idle_context_invoke: NameOwnerChanged(:1.310, -> :1.310) (process:13703): tp-glib/proxy-DEBUG: noc_idle_context_invoke: NameOwnerChanged(org.gnome.OnlineAccounts, :1.296 -> :1.310) (process:13703): tp-glib/proxy-DEBUG: noc_idle_context_invoke: NameOwnerChanged(org.gnome.OnlineAccounts, :1.296 -> :1.310) (process:13703): mcd-DEBUG: deleted_cb: goa reported deletion of gabble/jabber/goa_google_account_1384426078 (0x1570520) (process:13703): mcd-DEBUG: unref_account: called for gabble/jabber/goa_google_account_1384426078 (process:13703): mc-plugins-DEBUG: account-storage.c:806: goa: ** (process:13703): DEBUG: mcp_account_manager_goa_delete: (gabble/jabber/goa_google_account_1384426078, (null)) (process:13703): mc-plugins-DEBUG: account-storage.c:806: default-gkeyfile: (process:13703): mcd-DEBUG: mcd_storage_commit: flushing plugin goa gabble/jabber/goa_google_account_1384426078 to long term storage (process:13703): mc-plugins-DEBUG: account-storage.c:907: goa: called for gabble/jabber/goa_google_account_1384426078 (process:13703): mc-plugins-DEBUG: account-storage.c:849: goa: committing all accounts ** (process:13703): DEBUG: Save config to /home/cassidy/.local/share/telepathy/mission-control/accounts-goa.cfg (process:13703): mcd-DEBUG: mcd_storage_commit: flushing plugin default-gkeyfile gabble/jabber/goa_google_account_1384426078 to long term storage (process:13703): mc-plugins-DEBUG: account-storage.c:907: default-gkeyfile: called for gabble/jabber/goa_google_account_1384426078 (process:13703): mcd-DEBUG: _mcd_account_dispose: 0x1570520 (gabble/jabber/goa_google_account_1384426078) (process:13703): mcd-DEBUG: _mcd_account_finalize: 0x1570520 (gabble/jabber/goa_google_account_1384426078) (process:13703): mcd-DEBUG: deleted_cb: goa reported deletion of gabble/jabber/goa_facebook_account_1377685019 (0x15703d0) (process:13703): mcd-DEBUG: unref_account: called for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mc-plugins-DEBUG: account-storage.c:644: goa: (process:13703): mc-plugins-DEBUG: account-storage.c:602: goa: ** (process:13703): DEBUG: mcp_account_manager_goa_set: (gabble/jabber/goa_facebook_account_1377685019, Enabled, false) (process:13703): mcd-DEBUG: update_storage: MCP:goa -> store gabble/jabber/goa_facebook_account_1377685019.Enabled (process:13703): mcd-DEBUG: update_storage: MCP:default-gkeyfile -> delete gabble/jabber/goa_facebook_account_1377685019.Enabled (process:13703): mc-plugins-DEBUG: account-storage.c:806: default-gkeyfile: (process:13703): mcd-DEBUG: mcd_account_changed_property: called: Enabled (process:13703): mcd-DEBUG: mcd_account_changed_property: First changed property (process:13703): mc-plugins-DEBUG: account-storage.c:806: goa: ** (process:13703): DEBUG: mcp_account_manager_goa_delete: (gabble/jabber/goa_facebook_account_1377685019, (null)) (process:13703): mc-plugins-DEBUG: account-storage.c:806: default-gkeyfile: (process:13703): mcd-DEBUG: mcd_storage_commit: flushing plugin goa gabble/jabber/goa_facebook_account_1377685019 to long term storage (process:13703): mc-plugins-DEBUG: account-storage.c:907: goa: called for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mc-plugins-DEBUG: account-storage.c:849: goa: committing all accounts ** (process:13703): DEBUG: Save config to /home/cassidy/.local/share/telepathy/mission-control/accounts-goa.cfg (process:13703): mcd-DEBUG: mcd_storage_commit: flushing plugin default-gkeyfile gabble/jabber/goa_facebook_account_1377685019 to long term storage (process:13703): mc-plugins-DEBUG: account-storage.c:907: default-gkeyfile: called for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mcd-DEBUG: mcd_account_delete: Forcing Account.Removed for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mc-plugins-DEBUG: account-storage.c:548: goa: ** (process:13703): DEBUG: mcp_account_manager_goa_get: gabble/jabber/goa_facebook_account_1377685019, (null) (process:13703): mcd-DEBUG: _mcd_account_constructed: 0x1570520 (gabble/jabber/goa_facebook_account_1377685019) (process:13703): mc-plugins-DEBUG: account-storage.c:644: goa: (process:13703): mc-plugins-DEBUG: account-storage.c:602: goa: ** (process:13703): DEBUG: mcp_account_manager_goa_set: (gabble/jabber/goa_facebook_account_1377685019, AutomaticPresence, 0;;;) (process:13703): mcd-DEBUG: update_storage: MCP:goa -> store gabble/jabber/goa_facebook_account_1377685019.AutomaticPresence (process:13703): mcd-DEBUG: update_storage: MCP:default-gkeyfile -> delete gabble/jabber/goa_facebook_account_1377685019.AutomaticPresence (process:13703): mc-plugins-DEBUG: account-storage.c:806: default-gkeyfile: (process:13703): mcd-DEBUG: mcd_storage_commit: flushing plugin goa gabble/jabber/goa_facebook_account_1377685019 to long term storage (process:13703): mc-plugins-DEBUG: account-storage.c:907: goa: called for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mc-plugins-DEBUG: account-storage.c:849: goa: committing all accounts ** (process:13703): DEBUG: Save config to /home/cassidy/.local/share/telepathy/mission-control/accounts-goa.cfg (process:13703): mcd-DEBUG: mcd_storage_commit: flushing plugin default-gkeyfile gabble/jabber/goa_facebook_account_1377685019 to long term storage (process:13703): mc-plugins-DEBUG: account-storage.c:907: default-gkeyfile: called for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mcd-DEBUG: mcd_account_check_parameters: called for gabble/jabber/goa_facebook_account_1377685019 (process:13703): mcd-DEBUG: mcd_account_would_like_to_connect: gabble/jabber/goa_facebook_account_1377685019 does not ConnectAutomatically, and its RequestedPresence (1, 'offline', '') doesn't indicate the user wants to be online ** (process:13703): ERROR **: Failed to register GObject with DBusConnection: org.freedesktop.DBus.Error.ObjectPathInUse A handler is already registered for /org/freedesktop/Telepathy/Account/gabble/jabber/goa_facebook_account_1377685019 Note that I had to fix bug #79832 first before being able to reproduce this issue with MC master. When GOA is restarted, here is what happens from MC's pov: - Each GOA account is removed - Each GOA account is created We are hitting this assertion because the old McdAccount is still alive when the new one is created for the account. There are two reasons for this: - In mcd_account_delete_async() we call _mcd_account_set_enabled () to disable enabled accounts. This calls mcd_account_changed_property() which is going to do this change async and so ref the McdAccount will doing so. - mcd_account_delete_async() uses a GTask internally; it doesn't really need it as all its work in sync but it's a convenient object to report error or success to the user callback. But when it calls g_task_return_boolean() GTask will internally calls the user callback in an idle callback and so keeping its source object (the McdAccount) alive longer. We could solve the first problem by not updating the Account.Enabled property of the account when deleting it. Does it really make sense to update it for an account which is about to disappear anyway? An easy hackish solution for the second issue could be to use GSimpleAsyncResult instead of GTask with g_simple_async_result_complete() so the user callback is called right away. Or maybe mcd_account_delete_async() should just be a sync function as it doesn't really do any async work anyway? Another option could be to unregister the Account D-Bus object earlier in the deletion process to avoid such tricky issues. (In reply to comment #3) > - mcd_account_delete_async() uses a GTask internally; it doesn't really need > it as all its work in sync but it's a convenient object to report error or > success to the user callback. It is an API convention that async functions should always return in an async way, even if their implementation could have been sync: callers should be able to say "this will happen synchronously" or "this will take time" but never "this will happen sync or async depending on implementation and I can't tell which". Deleting accounts calls out to a potentially-external backend, so it can (conceptually) take time, so it is always async (even if the GOA backend is in fact blocking). > We could solve the first problem by not updating the Account.Enabled > property of the account when deleting it. Does it really make sense to > update it for an account which is about to disappear anyway? I believe the idea was: * if the account cannot be deleted, we do the closest thing we can * disabling the account has side-effects, like taking it offline and cancelling its channel requests, and we want those to happen regardless > Another option could be to unregister the Account D-Bus object earlier in > the deletion process to avoid such tricky issues. I feel as though this: > (process:13703): mcd-DEBUG: mcd_account_delete: Forcing Account.Removed for > gabble/jabber/goa_facebook_account_1377685019 ought to be the point at which the account is unregistered: that's the point at which we have "officially" removed it. Does that actually take place? When this code was written, dbus-glib had a bug (well, major feature omission): objects could only be removed from the bus via last-unref. We fixed that: you can now unregister objects explicitly. Our daemons should behave accordingly. > (process:13703): mc-plugins-DEBUG: account-storage.c:907: default-gkeyfile: > called for gabble/jabber/goa_facebook_account_1377685019 If this debug message logged the function name instead of the file+line, it would make a lot more sense. I can't tell which is "added" and which is "removed". The debug messages seem to have been written with the assumption that DEBUG() would log the function name. Created attachment 100740 [details] [review] use G_STRFUNC in mission-control-plugins's DEBUG macro Created attachment 100741 [details] [review] mcd-account: add unregister_dbus_service() Created attachment 100742 [details] [review] mcd-account: unregister the account once we're done deleting it Comment on attachment 100740 [details] [review] use G_STRFUNC in mission-control-plugins's DEBUG macro Review of attachment 100740 [details] [review]: ----------------------------------------------------------------- r+ Comment on attachment 100742 [details] [review] mcd-account: unregister the account once we're done deleting it Review of attachment 100742 [details] [review]: ----------------------------------------------------------------- r+, and so is the commit above that it depends on. That other commit would be wrong on its own (unused static function would break the build), so I would personally squash those two, taking the commit message from this one. Merged both commits to 5.16 for 5.16.2 and merged it back to master as well. OK mc is not crashing anymore, but now I'm seeing the following when using goa-daemon --replace mcd/-CRITICAL: 11/06/14 07:10:34.590511: unregister_dbus_service: assertion 'MCD_IS_ACCOUNT (self)' failed Goa/-WARNING: 11/06/14 07:10:34.626550: Error setting property 'ChatDisabled' on interface org.gnome.OnlineAccounts.Account: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) (g-dbus-error-quark, 4) Goa/-WARNING: 11/06/14 07:10:34.626638: Error setting property 'ChatDisabled' on interface org.gnome.OnlineAccounts.Account: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.16 was not provided by any .service files (g-dbus-error-quark, 2) mcd/-WARNING: 11/06/14 07:10:34.627469: disconnect_cb: Disconnect failed: Method "Disconnect" with signature "" on interface "org.freedesktop.Telepathy.Connection" doesn't exist mcd/-WARNING: 11/06/14 07:10:59.583623: disconnect_cb: Disconnect failed: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. (In reply to comment #11) > OK mc is not crashing anymore, but now I'm seeing the following when using > goa-daemon --replace > > mcd/-CRITICAL: 11/06/14 07:10:34.590511: unregister_dbus_service: assertion > 'MCD_IS_ACCOUNT (self)' failed Looks like I introduced this bug when backporting the patch from master to 5.16; patch on the way. Created attachment 100867 [details] [review] mcd_account_delete: make sure that the account stays alive Hey, OK, all the MC related warnings/error when goa is restarted are gone for me now. I still have the 'ChatDisabled' goa warning, but I guess this is a separate issue Comment on attachment 100867 [details] [review] mcd_account_delete: make sure that the account stays alive Review of attachment 100867 [details] [review]: ----------------------------------------------------------------- r+ Merged to 5.16. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.