diff --git a/oslo_cache/_opts.py b/oslo_cache/_opts.py index 6c8a7132..d90fd8c1 100644 --- a/oslo_cache/_opts.py +++ b/oslo_cache/_opts.py @@ -76,11 +76,11 @@ FILE_OPTIONS = { help='Number of seconds memcached server is considered dead' ' before it is tried again. (dogpile.cache.memcache and' ' oslo_cache.memcache_pool backends only).'), - cfg.IntOpt('memcache_socket_timeout', - default=3, - help='Timeout in seconds for every call to a server.' - ' (dogpile.cache.memcache and oslo_cache.memcache_pool' - ' backends only).'), + cfg.FloatOpt('memcache_socket_timeout', + default=3.0, + help='Timeout in seconds for every call to a server.' + ' (dogpile.cache.memcache and oslo_cache.memcache_pool' + ' backends only).'), cfg.IntOpt('memcache_pool_maxsize', default=10, help='Max total number of open connections to every' diff --git a/oslo_cache/backends/memcache_pool.py b/oslo_cache/backends/memcache_pool.py index df0f37e9..8703fd1a 100644 --- a/oslo_cache/backends/memcache_pool.py +++ b/oslo_cache/backends/memcache_pool.py @@ -45,7 +45,7 @@ class PooledMemcachedBackend(memcached_backend.MemcachedBackend): self.url, arguments={ 'dead_retry': arguments.get('dead_retry', 5 * 60), - 'socket_timeout': arguments.get('socket_timeout', 3), + 'socket_timeout': arguments.get('socket_timeout', 3.0), }, maxsize=arguments.get('pool_maxsize', 10), unused_timeout=arguments.get('pool_unused_timeout', 60), diff --git a/releasenotes/notes/memcache_socket_timeout-a7db772f052c107e.yaml b/releasenotes/notes/memcache_socket_timeout-a7db772f052c107e.yaml new file mode 100644 index 00000000..d974c554 --- /dev/null +++ b/releasenotes/notes/memcache_socket_timeout-a7db772f052c107e.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + `memcache_socket_timeout` is changed to float, given the same default value + '3.0'.