[Koha-devel] Cache::Memory must be removed (21955)

Jonathan Druart jonathan.druart at bugs.koha-community.org
Wed Dec 5 20:20:35 CET 2018

Hi devs,

I am still recovering from my holidays and I think I caught a quite big fish.

After an interesting track game I will explain why I am suggesting to
remove Cache::Memory that is currently used as fallback for the L2

What I tried to fix:
Jenkins is complaining about selenium tests (regressions.t) failing on
18.05, it is a succession of events and bugs that were not linked at
first glance.

Here are the different steps I went though:
- On bug 21426 we noticed that USE_MEMCACHED was not taken into
account. If set to "no" the default memcached config was defined in
the koha-config.xml file anyway
- A new regression selenium test was added on bug 21777 to catch the
presence of an audio alert on the circulation page
- Investigating the failing tests I noticed that koha-testing-docker
was not setting the memcached config on the 18.05 branches (I guess
the image has not been rebuilt yet)
search_utf8.t output "Warning: script running in daemon mode, without
recommended caching system (memcached)."
- I also find that [% Koha.Preference('AudioAlerts') %] did not return
the value set by the tests, but the value that the DB has before the
tests were launched
=> It is a cache issue!
- ...but only when memcached is not set...
- Reading Koha::Cache->new we can notice that Cache::Memory is used
for the L2 cache when memcached is not defined in the config

And so we have the problem: If a value is set in the cache by a Plack
worker, it will not be available from another one, as the L2 cache is
not shared (!)

To recreate easily the problem you can:
- remove the memcached config
- edit intranet-bottom.inc and add
===[% Koha.Preference('AudioAlerts') %]===
- restart plack
- Modify the value of AudioAlerts (using the UI)
- Reload the page (reload several times if the value is still correct,
it will depend on which worker will serve the request)

I am considering removing Cache::Memory unless somebody else has a better idea
Bug 21955 - Cache::Memory should not be used as L2 cache

Note that it should not affect a lot of people as everybody is
supposed to have memcached configured and working correctly!


More information about the Koha-devel mailing list