From 0fcc14666f8ce67a3dc27bfdc8a755d92ce290a5 Mon Sep 17 00:00:00 2001 From: Morgan Fainberg Date: Tue, 12 Apr 2016 02:13:16 -0700 Subject: [PATCH] Set the values for the request_local_cache Instead of only using the request_local_cache when an explicit set occurs, make sure we always set the value for the request_local_cache when we have to reach for the proxied backend. The Context Local cache was being used previously when we were seeing a mix of cache misses and hits. This change ensures we now always set the value(s) as expected: Change-Id: I4857cfe1e62d54c3c89a0206ffc895c4cf681ce5 Closes-Bug: #1567403 (cherry picked from commit 9b9bc7767fad36da1c764add842f85efdc48807b) --- keystone/common/cache/_context_cache.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keystone/common/cache/_context_cache.py b/keystone/common/cache/_context_cache.py index d9d3d43b7e..3895ca1f68 100644 --- a/keystone/common/cache/_context_cache.py +++ b/keystone/common/cache/_context_cache.py @@ -94,6 +94,8 @@ class _ResponseCacheProxy(proxy.ProxyBackend): value = self._get_local_cache(key) if value is api.NO_VALUE: value = self.proxied.get(key) + if value is not api.NO_VALUE: + self._set_local_cache(key, value) return value def set(self, key, value):