Bug 16068

Summary: System preference override feature (OVERRIDE_SYSPREF_* = ) is not reliable for some cache systems
Product: Koha Reporter: Jacek Ablewicz <abl>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: abl, brendan, jonathan.druart, julian.maurice, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 11998    
Bug Blocks: 16079    
Attachments: [master]Bug 16068: Do not cache overridden prefs
[on top of bug 16044]Bug 16068: Do not cache overridden prefs
[on top of bug 16044]Bug 16068: Do not cache overridden prefs
Bug 16068: Do not cache overridden prefs
[master]Bug 16068: Do not cache overridden prefs
[on top of bug 16044]Bug 16068: Do not cache overridden prefs
Bug 16068: Do not cache overridden prefs
Bug 16068: Do not cache overridden prefs

Description Jacek Ablewicz 2016-03-14 17:19:46 UTC
It is possibile in Koha to 'override' system preference values stored in the database, by setting environment variables (export OVERRIDE_SYSPREF_... = ... in shell, web server config file etc.). After Bug 11998, this feature may work unreliably when used in combination with shared/permanent caching systems (memcache, fastmmap) implemented in Koha::Cache currently.

- if the system preference is already stored in shared cache in the moment when (some) other script will try to override it, such override will seemingly have no effect for that script
- if the preference is not (yet) in the shared cache, and some script overrides it "for it's own purpose", this override will get propagated to the shared cache, and may unintentionally affect other scripts from now on
Comment 1 Jonathan Druart 2016-03-15 09:42:27 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-03-15 09:43:38 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-03-15 09:56:41 UTC Comment hidden (obsolete)
Comment 4 Jacek Ablewicz 2016-03-15 11:11:12 UTC Comment hidden (obsolete)
Comment 5 Jacek Ablewicz 2016-03-15 11:13:36 UTC Comment hidden (obsolete)
Comment 6 Jacek Ablewicz 2016-03-15 12:00:58 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-03-18 16:25:12 UTC
Raising the severity as we absolutely want to into the next release.
Comment 8 Martin Renvoize 2016-04-01 14:43:45 UTC
16044 is pushed to master now.. presume we only need the one patch.. (in fact they look the same to me on cursory glance)

Obsoleting the 'on top of bug 16044' version and qa'ing the other.
Comment 9 Martin Renvoize 2016-04-01 14:53:30 UTC
On second thoughts, it looks like it needs rebasing.. I've un-obsoleted the one I obsoleted.

Applying the 'master' one results in a qa script error:

    FAIL   valid
                Global symbol "%syspref_L1_cache" requires explicit package name 
                Compilation failed in require 
                BEGIN failed--compilation aborted 

As I'm not totally up to speed on this, I'm going to leave re-basing to someone else.. even though it looks trivial.
Comment 10 Jacek Ablewicz 2016-04-01 16:07:27 UTC Comment hidden (obsolete)
Comment 11 Martin Renvoize 2016-04-01 18:54:46 UTC
Created attachment 49813 [details] [review]
Bug 16068: Do not cache overridden prefs

These prefs do not need to be cached, a quick access to $ENV permit to
get the value.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2016-04-01 18:55:43 UTC
Sorted, works as advertised passing all my testing with flying colours. Good catch!
Comment 13 Brendan Gallagher 2016-04-01 19:20:24 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 14 Julian Maurice 2016-04-06 13:17:45 UTC
Patch pushed to 3.22.x, will be in 3.22.6