Bug 19523

Summary: Koha::Cache changes not passed to all plack workers with in-memory caching.
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, fridolin.somers, lari.taskula
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11998
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21955
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18232    
Bug Blocks:    
Attachments: Bug 19523 - Koha::Cache changes not passed to all plack workers with in-memory caching.
Bug 19532: Some fiddly fixes

Description Olli-Antti Kivilahti 2017-10-24 13:49:24 UTC
REPRODUCE:

- $KOHA_CONF shouldn't have any <memcached_* -definitions. This triggers in-memory cache usage.
- plack workers is atleast 2
- Change some easily visible syspref, such as 'languages'. The syspref change applies only to the worker thread where the change was made. Other worker threads keep using the old syspref.
- Observer that 50% of time the old syspref is used. Other times the new syspref is used.
- Reduce plack workers to 1. Observe no issues with syspref change taking effect.


Using memcached solves this problem.

It is still useful to fix it for those who don't want to use memcached.
Comment 1 Olli-Antti Kivilahti 2017-10-24 13:51:06 UTC
Created attachment 68469 [details] [review]
Bug 19523 - Koha::Cache changes not passed to all plack workers with in-memory caching.

REPRODUCE:

- $KOHA_CONF shouldn't have any <memcached_* -definitions. This triggers in-memory cache usage.
- plack workers is atleast 2
- Change some easily visible syspref, such as 'languages'. The syspref change applies only to the worker thread where the change was made. Other worker threads keep using the old syspref.
- Observe that 50% of time the old syspref is used. Other times the new syspref is used.
- Reduce plack workers to 1. Observe no issues with syspref change taking effect.

Using memcached solves this problem.

It is still useful to fix it for those who don't want to use memcached.
Comment 2 Aleisha Amohia 2017-11-24 01:53:45 UTC
Created attachment 69325 [details] [review]
Bug 19532: Some fiddly fixes

Little typos etc
Comment 3 Lari Taskula 2018-06-11 14:44:47 UTC
Comment on attachment 69325 [details] [review]
Bug 19532: Some fiddly fixes

Removed patch from another bug :)
Comment 4 Fridolin Somers 2018-08-01 07:29:48 UTC
Indeed, Memcached is recomanded with Plack.
Comment 5 David Cook 2019-09-19 01:45:03 UTC
I found the title and description for this misleading, but the patch looks good at a glance.