From 5f42092e2cba1d9e9711d819a2792dd264a887fd Mon Sep 17 00:00:00 2001 From: Morgan Fainberg Date: Tue, 6 Nov 2018 11:30:55 -0800 Subject: [PATCH] Only split url arg with memcache backend Only split the url arg with the memcache backend, the list form breaks the redis backend driver / library. Change-Id: Id0e1d9351a92ba862e48f088ff15d1f77b6105d9 Closes-Bug: #1801967 (cherry picked from commit 356cdc13b6aac02c688dba4c050acfc795678ffa) --- oslo_cache/core.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/oslo_cache/core.py b/oslo_cache/core.py index dd623e09..5b7dcfad 100644 --- a/oslo_cache/core.py +++ b/oslo_cache/core.py @@ -120,7 +120,17 @@ def _build_cache_config(conf): continue arg_key = '.'.join([prefix, 'arguments', argname]) - if argname == 'url': + # NOTE(morgan): The handling of the URL data in memcache is bad and + # only takes cases where the values are a list. This explicitly + # checks for the base dogpile.cache.memcached backend and does the + # split if needed. Other backends such as redis get the same + # previous behavior. Overall the fact that the backends opaquely + # take data and do not handle processing/validation as expected + # directly makes for odd behaviors when wrapping dogpile.cache in + # a library like oslo.cache + if (conf.cache.backend + in ('dogpile.cache.memcached', 'oslo_cache.memcache_pool') + and argname == 'url'): argvalue = argvalue.split(',') conf_dict[arg_key] = argvalue