Bug 16105

Summary: Cache::Memory is loaded even if memcache is used
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: abl, brendan, julian.maurice, katrin.fischer, kyle, mirko
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: 16104, 11998    
Bug Blocks:    
Attachments: Bug 16105: Do not initialize the memory cache if not needed
Bug 16105: [DO NOT PUSH] warn to test the patch
Bug 16105: Do not initialize the memory cache if not needed
Bug 16105: Do not initialize the memory cache if not needed

Description Jonathan Druart 2016-03-18 13:38:29 UTC
Cache::Memory is loaded and Koha::Cache::_initialize_memory is called even if a memcached cache has been correctly initialize, it does not make sense.
It should only be initialize if needed.
Comment 1 Jonathan Druart 2016-03-18 13:42:05 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2016-04-14 18:53:49 UTC
(In reply to Jonathan Druart from comment #1)

> Correctly configure a memcache server and confirm that the memory cache
> is not initialize.

How do I do that (the second part)?
Comment 3 Jonathan Druart 2016-04-15 08:23:32 UTC
Created attachment 50260 [details] [review]
Bug 16105: [DO NOT PUSH] warn to test the patch

Test plan:
Apply this patch
Notice the 2 warnings:
  init memcached
  init memory
in the log
Apply the second patch "Do not initialize the memory cache if not needed"
Notice the single warning:
  init memcached
Comment 4 Jonathan Druart 2016-04-15 08:24:10 UTC
(In reply to Mirko Tietgen from comment #2)
> (In reply to Jonathan Druart from comment #1)
> 
> > Correctly configure a memcache server and confirm that the memory cache
> > is not initialize.
> 
> How do I do that (the second part)?

When you are lost, put some warns :p
See this second patch and its test plan to test the patch.
Comment 5 Chris Cormack 2016-04-28 02:28:04 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2016-04-28 12:33:41 UTC
enh or bug?
Comment 7 Kyle M Hall 2016-04-28 12:46:12 UTC
Created attachment 50911 [details] [review]
Bug 16105: Do not initialize the memory cache if not needed

Cache::Memory is loaded and Koha::Cache::_initialize_memory is called
even if a memcached cache has been correctly initialize, it does not
make sense.
It should only be initialize if needed.

Test plan:
Correctly configure a memcache server and confirm that the memory cache
is not initialize.
Do not configure correctly a memcache server and confirm that the cache
system default on Cache::Memory

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Brendan Gallagher 2016-04-29 02:51:13 UTC
Pushed to Master - should be in the May 2016 - Release.   Thanks!
Comment 9 Julian Maurice 2016-05-16 10:21:46 UTC
Patch pushed to 3.22.x, will be in 3.22.7