Bug 16068 - System preference override feature (OVERRIDE_SYSPREF_* = ) is not reliable for some cache systems
Summary: System preference override feature (OVERRIDE_SYSPREF_* = ) is not reliable fo...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 11998
Blocks: 16079
  Show dependency treegraph
 
Reported: 2016-03-14 17:19 UTC by Jacek Ablewicz
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
[master]Bug 16068: Do not cache overridden prefs (1.45 KB, patch)
2016-03-15 09:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
[on top of bug 16044]Bug 16068: Do not cache overridden prefs (1.38 KB, patch)
2016-03-15 09:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
[on top of bug 16044]Bug 16068: Do not cache overridden prefs (1.37 KB, patch)
2016-03-15 09:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16068: Do not cache overridden prefs (1.50 KB, patch)
2016-03-15 11:11 UTC, Jacek Ablewicz
Details | Diff | Splinter Review
[master]Bug 16068: Do not cache overridden prefs (1.50 KB, patch)
2016-03-15 11:13 UTC, Jacek Ablewicz
Details | Diff | Splinter Review
[on top of bug 16044]Bug 16068: Do not cache overridden prefs (1.42 KB, patch)
2016-03-15 12:00 UTC, Jacek Ablewicz
Details | Diff | Splinter Review
Bug 16068: Do not cache overridden prefs (1.40 KB, patch)
2016-04-01 16:07 UTC, Jacek Ablewicz
Details | Diff | Splinter Review
Bug 16068: Do not cache overridden prefs (1.46 KB, patch)
2016-04-01 18:54 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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