GNOME Bugzilla – Bug 704619
Seahorse search provider comes up empty for the first search
Last modified: 2015-07-14 19:58:19 UTC
If just open the overview and start typing, the first time you won't get any results. This is because the GetInitialResultSet call happens when the backends are not loaded yet. The following patch set changes it so that requests happening too early are queued until ready. For some reason, a cold GIRS call takes around 25 seconds here, so it timeouts with the default GDBusProxy timeout. Attaching a GDB hints to avahi-client, but manually invoking the avahi methods is fast, so maybe it's some other library blocking libdbus.
Created attachment 249715 [details] [review] common: add a loaded property to SeahorseBackend All backends initialize asynchronously, but some of the users (in particular SeahorseSearchProvider) might want to know when the backends are fully populated before the access the collections.
Created attachment 249716 [details] [review] search provider: wait until all backends are loaded before serving requests Queue all GetInitialResultSet calls that happen before all backends are loaded, and reply to them when ready.
Created attachment 249717 [details] [review] search provider: keep application alive for dbus calls If we don't do so, we get the default timeout of 10 seconds (due to IS_SERVICE), and the inactivity timeout never starts. Also, we don't know how long it takes for async loading of backends, and we don't want to trigger NoReply errors.
Created attachment 249718 [details] [review] Recognize and filter invalid GObject pointers We can't even run G_IS_OBJECT() on untrusted pointers, because that reads the GTypeClass pointer. Instead, use mincore() to determine if a pointer is valid in our address space or not.
Review of attachment 249718 [details] [review]: Starting off with this bit... I think it would be far better to keep a GHashTable of valid returned objects in the search provider. You can do this with g_object_weak_ref() and g_object_weak_unref() and friends.
Created attachment 298836 [details] [review] Application: unbreak the search provider It must be initialized after backends are registered, otherwise it will always report 0 secrets.
Created attachment 298837 [details] [review] Double the inactivity timeout Even on fast storage it takes some time to load all keyrings and certificates, which means the first search after started is slow. Mitigate this by reducing how often the daemon is unloaded.
The object handle problem was fixed, would it be possible to have a review on the other patches? Otherwise the search provider as it currently stands is completely broken.
Attachment 249715 [details] pushed as 60b63a9 - common: add a loaded property to SeahorseBackend Attachment 249716 [details] pushed as efaa15c - search provider: wait until all backends are loaded before serving requests Attachment 249717 [details] pushed as e1263e9 - search provider: keep application alive for dbus calls Attachment 298836 [details] pushed as 7d05d9f - Application: unbreak the search provider Attachment 298837 [details] pushed as b6c9c01 - Double the inactivity timeout