From dcf080c16ddd23b615085cb1c26bf7d92700fcb5 Mon Sep 17 00:00:00 2001 From: asher Date: Wed, 12 Jun 2013 12:39:39 -0700 Subject: [PATCH] support setting Memcached::OPT_SERVER_FAILURE_LIMIT, Memcached::OPT_RETRY_TIMEOUT Change-Id: Ib1fcae92b65e8fd23baee7af7ed64abd908b600e --- includes/objectcache/MemcachedPeclBagOStuff.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/objectcache/MemcachedPeclBagOStuff.php b/includes/objectcache/MemcachedPeclBagOStuff.php index 748c4235bb..f9621624b1 100644 --- a/includes/objectcache/MemcachedPeclBagOStuff.php +++ b/includes/objectcache/MemcachedPeclBagOStuff.php @@ -37,6 +37,8 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { * - compress_threshold: The minimum size an object must be before it is compressed * - timeout: The read timeout in microseconds * - connect_timeout: The connect timeout in seconds + * - retry_timeout: Time in seconds to wait before retrying a failed connect attempt + * - server_failure_limit: Limit for server connect failures before it is removed * - serializer: May be either "php" or "igbinary". Igbinary produces more compact * values, but serialization is much slower unless the php.ini option * igbinary.compact_strings is off. @@ -61,6 +63,14 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { $params['serializer'] = 'php'; } + if ( isset( $params['retry_timeout'] ) ) { + $this->client->setOption( Memcached::OPT_RETRY_TIMEOUT, $params['retry_timeout'] ); + } + + if ( isset ( $params['server_failure_limit'] ) ) { + $this->client->setOption( Memcached::OPT_SERVER_FAILURE_LIMIT, $params['server_failure_limit'] ); + } + // The compression threshold is an undocumented php.ini option for some // reason. There's probably not much harm in setting it globally, for // compatibility with the settings for the PHP client. -- 2.20.1