Summary: | _initilize_memcached() warns if errors | ||
---|---|---|---|
Product: | Koha | Reporter: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Component: | Architecture, internals, and plumbing | Assignee: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, m.de.rooy, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 17833 - Memcached silently fails to _initilize_memcached() on the second time it is invoked
Bug 17833 - _initilize_memcached() warns if errors Bug 17833 - _initilize_memcached() warns if errors Bug 17833 - _initilize_memcached() warns if errors Bug 17833: Make sure this warning will not be ignored |
Description
Olli-Antti Kivilahti
2017-01-02 11:13:37 UTC
Created attachment 58554 [details] [review] Bug 17833 - Memcached silently fails to _initilize_memcached() on the second time it is invoked When _initilize_memcached() is called the first time, it sets the 'ismemcached'-key and returns 1. When _initilize_memcached() is called the second time, the 'ismemcached'-key already exists and '' is returned (this default to False in Perl). Koha thinks that memcached is not in use and decides to use some other caching mechanism instead. Cache::Memcached::Fast returns undef on server error: https://metacpan.org/pod/Cache::Memcached::Fast#add Koha MUST listen to undefined, instead of False to define whether or not memcached is properly working. Also added simple helpful diagnostics to help identify and log when this memcached server connection problem arises. You are mixing add and set, replace ->add with ->set in your snippet and it will work as expected. Set will return 1 even if the key already exists. It seems that this is invalid, waiting for Olli's confirmation. Thanks for digging into this Jonathan! You are correct. The culprit was misconfigured socket permission. Same behaviour is expected on any connection issue to the memcached server. I changed the bug title and content to only add warnings when a server/connection problem occurs. Created attachment 58556 [details] [review] Bug 17833 - _initilize_memcached() warns if errors If memcached or the connection to it is misconfigured, show simple warnings to help identify the problem. Created attachment 68162 [details] [review] Bug 17833 - _initilize_memcached() warns if errors If memcached or the connection to it is misconfigured, show simple warnings to help identify the problem. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Small change, didn't appear to break something in my testing. Created attachment 70281 [details] [review] Bug 17833 - _initilize_memcached() warns if errors If memcached or the connection to it is misconfigured, show simple warnings to help identify the problem. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 70307 [details] [review] Bug 17833: Make sure this warning will not be ignored Pushed to master for 18.05, thanks to everybody involved! Enhancement, skipping for 17.11.x. Awesome work everybody! |