After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 712617 - Synchronous D-Bus calls when loading the Flickr plugin
Synchronous D-Bus calls when loading the Flickr plugin
Status: RESOLVED OBSOLETE
Product: grilo
Classification: Other
Component: plugins
0.2.x
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
: 731606 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-11-18 17:22 UTC by Andreas Nilsson
Modified: 2018-09-24 09:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Nilsson 2013-11-18 17:22:50 UTC
GNOME Photos is blank for about 3 seconds after it launched on a SSD disk.
This is actually slower than Libreoffice.
Comment 1 Debarshi Ray 2013-11-18 19:06:05 UTC
- Did you have any non-local photo sources added? eg., Flickr.
- What happens if you kill and restart the application? Is it still slow?
Comment 2 Andreas Nilsson 2013-11-18 20:21:02 UTC
1. No
2. No change
Comment 3 André Klapper 2015-01-26 05:42:14 UTC
andreasn: Still an issue in 3.14? Or is this RESOLVED OBSOLETE?
Comment 4 Debarshi Ray 2015-10-12 15:29:35 UTC
(In reply to André Klapper from comment #3)
> andreasn: Still an issue in 3.14? Or is this RESOLVED OBSOLETE?

Yes, this is still an issue. I can reproduce it with current master.
Comment 5 Debarshi Ray 2015-10-12 15:35:14 UTC
With gnome-photos master and grilo-0.2.11, I get this back trace on slow start-ups.

$ gstack $(pidof gnome-photos)
...
<snipped out noise about other idle threads>
...

Thread 1 (Thread 0x7fd614139a40 (LWP 32470))

  • #0 poll
    at ../sysdeps/unix/syscall-template.S line 81
  • #1 g_main_context_poll
    at gmain.c line 4135
  • #2 g_main_context_iterate
    at gmain.c line 3835
  • #3 g_main_loop_run
    at gmain.c line 4034
  • #4 g_dbus_connection_send_message_with_reply_sync
    at gdbusconnection.c line 2147
  • #5 g_dbus_connection_call_sync_internal
    at gdbusconnection.c line 5930
  • #6 g_dbus_connection_call_with_unix_fd_list_sync
    at gdbusconnection.c line 6276
  • #7 g_dbus_proxy_call_sync_internal
    at gdbusproxy.c line 2852
  • #8 g_dbus_proxy_call_sync
    at gdbusproxy.c line 3044
  • #9 goa_oauth_based_call_get_access_token_sync
    from /opt/lib/libgoa-1.0.so.0
  • #10 grl_flickr_plugin_init
    from /usr/lib64/grilo-0.2/libgrlflickr.so
  • #11 grl_plugin_load
    at grl-plugin.c line 225
  • #12 activate_plugin
    at grl-registry.c line 367
  • #13 grl_registry_load_plugin
    at grl-registry.c line 1018
  • #14 grl_registry_load_plugin_by_id
    at grl-registry.c line 1158
  • #15 photos_application_startup
    at photos-application.c line 840
  • #16 _g_closure_invoke_va
    at gclosure.c line 864
  • #17 g_signal_emit_valist
    at gsignal.c line 3292
  • #18 g_signal_emit
    at gsignal.c line 3439
  • #19 g_application_register
    at gapplication.c line 2015
  • #20 g_application_real_local_command_line
    at gapplication.c line 983
  • #21 g_application_run
    at gapplication.c line 2280
  • #22 main
    at photos-main.c line 60

So, this boils down to this function call in our application's startup vfunc:
grl_registry_load_plugin_by_id (registry, "grl-flickr", &error)
Comment 6 Debarshi Ray 2015-10-21 10:04:57 UTC
Reassigning to grilo:
https://mail.gnome.org/archives/grilo-list/2015-October/msg00002.html
Comment 7 Pranav Kant 2015-10-21 19:39:38 UTC
So, adding an asynchronous version for `grl_registry_load_plugin_by_id` and friends seems to be the solution to me here to prevent the consumer apps encountering cases like this. Or, I can change the existing such functions to async ? (but that would break so many things, so not the best approach, I think ?)
Comment 8 Debarshi Ray 2017-02-17 08:53:07 UTC
*** Bug 731606 has been marked as a duplicate of this bug. ***
Comment 9 Debarshi Ray 2017-02-17 09:51:09 UTC
Ping. What's the way forward here?

Bug 731606 says that it also affects totem at startup.

Aside from stalling gnome-photos on startup, the Flickr integration has been completely broken. The helper process that is used to populate the offline cache with Flickr metadata doesn't work because D-Bus calls time out due to this.

I wonder if it will be better to let the application create a GrlSource for a given GoaObject instead of grilo trying to enumerate the sources at startup. 

An application might already have its own list of GoaObjects to deal with functionality beyond Grilo. For example, gnome-documents/photos uses other GNOME SDKs for online accounts like libgdata, libgfbgraph, libzapojit; the applications issue notifications to indicate the status of those accounts - is the metadata being fetched, are credentials for those accounts still valid, etc..

It might also happen that even though there is a Flickr account, the application won't ever need the GrlSource because all the necessary metadata, thumbnails and images are already cached locally.

Hence, I think the application is in a better position to know when a particular GrlSource would be needed.
Comment 10 Bastien Nocera 2017-02-17 11:40:41 UTC
(In reply to Debarshi Ray from comment #9)
> Ping. What's the way forward here?
> 
> Bug 731606 says that it also affects totem at startup.
> 
> Aside from stalling gnome-photos on startup, the Flickr integration has been
> completely broken. The helper process that is used to populate the offline
> cache with Flickr metadata doesn't work because D-Bus calls time out due to
> this.
> 
> I wonder if it will be better to let the application create a GrlSource for
> a given GoaObject instead of grilo trying to enumerate the sources at
> startup. 

That's what the lua plugin does. There's nothing stopping you from implementing something similar, eg. create the source async'ly after the plugin has been instantiated. No API changes necessary.

I'd welcome a Flickr plugin reimplemented in Lua, fwiw, would save us a few headaches.
Comment 11 GNOME Infrastructure Team 2018-09-24 09:23:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/grilo/issues/33.