Summary: | MARC framework editing is broken when memcache is enabled | ||
---|---|---|---|
Product: | Koha | Reporter: | Bob Birchall <bob> |
Component: | Architecture, internals, and plumbing | Assignee: | Robin Sheat <robin> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, jonathan.druart, katrin.fischer, magnus, robin, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 12041 | ||
Bug Blocks: | 12173, 12800, 13431, 16955 | ||
Attachments: |
Bug 11842 - fix framework caching with memcache/plack
Bug 11842 - fix framework caching with memcache/plack [signed off] Bug 11842 - fix framework caching with memcache/plack Bug 11842 - fix framework caching with memcache/plack |
Description
Bob Birchall
2014-02-26 06:28:02 UTC
There's two levels of caching happening, memoisation and an in process cache. Both must go. Created attachment 26947 [details] [review] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Created attachment 26948 [details] [review] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Test plan: * work through http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0 and make sure that the erronious result doesn't occur. Note: * The patch on bug 12041 is required for this to work. Created attachment 28414 [details] [review] [signed off] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Test plan: * work through http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0 and make sure that the erronious result doesn't occur. Note: * The patch on bug 12041 is required for this to work. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> I haven't tried using memcache/caching in ages. What's required to set it up on a git dev installation? (In reply to Katrin Fischer from comment #5) > I haven't tried using memcache/caching in ages. What's required to set it up > on a git dev installation? Install memcache and then add some SetEnv lines to your apache config, e.g. SetEnv MEMCACHED_SERVERS 127.0.0.1:11211 SetEnv MEMCACHED_NAMESPACE koha make sure memcached is actually running, and it should just start working. There's a script that comes with memcache that lets you dump all its contents which is handy to see that it's actually being used. Created attachment 29917 [details] [review] Bug 11842 - fix framework caching with memcache/plack This changes the existing framework caching, which was using memoisation if memcached was available, and memory in all cases, to use the Koha::Cache system. This uses memcache if possible, and in-memory otherwise. However it also clears the cache when the framework updates, making sure that the changed version will be picked up. Note that the in-memory cache clears itself after 10 seconds, so that if memcached isn't available, this is the longest that old versions will hang around. Test plan: * work through http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11842#c0 and make sure that the erronious result doesn't occur. Note: * The patch on bug 12041 is required for this to work. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> I confirm the issue and that this patch fixes it! Is this bug present in current maste ror just 3.12? Also, does it affect any setup or just Plack? (In reply to Tomás Cohen Arazi from comment #8) > Is this bug present in current maste ror just 3.12? Also, does it affect any > setup or just Plack? I tested on master. I didn't reproduce the issue without Plack OR Memcache. Patch pushed to master. Thanks Robin! I think this might have an unwanted side effect. When trying to access my MARC bibliographic frameworks from administration, following erros is shown: Open of share file /tmp/sharefile-koha-koha failed: Permission denied at /usr/lib/perl5/Cache/FastMmap.pm line 640. I haven't set up caching or anything. |