Use BMemcacheClientPool if tls_enabled=true
This commit adds the tls_enabled parameter to the conf_dict, so to eventually use it in the backend driver. In addition, it switches from _memcache_pool.MemcacheClientPool to _bmemcache_pool.BMemcacheClientPool when tls_enabled=true (python-memcached does not support tls anyway). Jira: https://issues.redhat.com/browse/OSPRH-16651 Change-Id: I1ceac2aa96c23227caf202b16f9a520083745537 (cherry picked from commitc3023dbc2e) (cherry picked from commit5d7c471509)
This commit is contained in:
@@ -56,7 +56,8 @@ class PooledMemcachedBackend(memcached_backend.MemcachedBackend):
|
||||
# Composed from GenericMemcachedBackend's and MemcacheArgs's __init__
|
||||
def __init__(self, arguments):
|
||||
super(PooledMemcachedBackend, self).__init__(arguments)
|
||||
if arguments.get('sasl_enabled', False):
|
||||
if (arguments.get('tls_enabled', False) or
|
||||
arguments.get('sasl_enabled', False)):
|
||||
self.client_pool = _bmemcache_pool.BMemcacheClientPool(
|
||||
self.url,
|
||||
arguments,
|
||||
|
||||
@@ -189,6 +189,9 @@ def _build_cache_config(conf):
|
||||
|
||||
conf_dict['%s.arguments.tls_context' % prefix] = tls_context
|
||||
|
||||
# pass the value of tls_enabled to the backend
|
||||
conf_dict['%s.arguments.tls_enabled' % prefix] = conf.cache.tls_enabled
|
||||
|
||||
# NOTE(hberaud): Pymemcache support socket keepalive, If it is enable in
|
||||
# our config then configure it to enable this feature.
|
||||
# The socket keepalive feature means that pymemcache will be able to check
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
If tls_enabled=true memcache_pool has been switched to use bmemcached.
|
||||
Reference in New Issue
Block a user