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 700311 - Use a different cache per plugin
Use a different cache per plugin
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2013-05-14 15:45 UTC by Sergio Villar
Modified: 2013-05-15 19:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (3.27 KB, patch)
2013-05-14 15:46 UTC, Sergio Villar
committed Details | Review
test-ui: shutdown plugins on exit (2.00 KB, patch)
2013-05-14 15:47 UTC, Sergio Villar
committed Details | Review

Description Sergio Villar 2013-05-14 15:45:20 UTC
As each plugin uses its own SoupSession, grilo must set a different SoupCache for each SoupSession. Being a SoupSessionFeature, the SoupCache can only be associated to a single SoupSession.

This was making the plugins to cache stuff randomly as only the first one to setup its session will use the cache.
Comment 1 Sergio Villar 2013-05-14 15:46:17 UTC
Created attachment 244201 [details] [review]
Patch
Comment 2 Sergio Villar 2013-05-14 15:47:39 UTC
Created attachment 244202 [details] [review]
test-ui: shutdown plugins on exit

Let the plugins clear their caches on program exit. As it's done in the plugin finalize we have to unload the plugins from the registry first.
Comment 3 Juan A. Suarez Romero 2013-05-15 14:24:03 UTC
Are you missing some patch? I see patch 2/3 and 3/3, but not 1/3.
Comment 4 Juan A. Suarez Romero 2013-05-15 19:21:14 UTC
commit 5140418233f2f8822c7e30e8353a155bb0a91aa7
Author: Sergio Villar Senin <svillar@igalia.com>
Date:   Tue May 14 17:34:47 2013 +0200

    test-ui: shutdown plugins on exit
    
    Unload plugins on program exit. The registry will call the finalize
    method on each plugin before the program ends to allow things like
    clearing the plugins HTTP cache.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700311

 tools/grilo-test-ui/main.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

commit 23fe14ed52ed620ded17d453419d560d314791e2
Author: Sergio Villar Senin <svillar@igalia.com>
Date:   Tue May 14 17:34:25 2013 +0200

    net: use a different cache per session
    
    The SoupCache is a SoupSessionFeature so it could only be attached
    to a single SoupSession. A new SoupCache is created for each
    SoupSession.
    
    Also the cache contents are now destroyed on finalize.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700311

 libs/net/grl-net-soup-unstable.c | 53 +++++++++++++++++++++++++++++++++++------------------
 1 file changed, 35 insertions(+), 18 deletions(-)


Attachment 244202 [details] pushed as 5140418 - test-ui: shutdown plugins on exit