From cac2302f6b420f9cbd23f3350840829f193a1a2f Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Tue, 27 Oct 2009 07:26:43 +0000 Subject: [PATCH] fix blacklist of dead servers --- includes/memcached-client.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/memcached-client.php b/includes/memcached-client.php index eb5478ed9e..3367c618ba 100644 --- a/includes/memcached-client.php +++ b/includes/memcached-client.php @@ -737,6 +737,11 @@ class memcached function _dead_sock ($sock) { $host = array_search($sock, $this->_cache_sock); + $this->_dead_host($host); + } + + function _dead_host ($host) + { @list ($ip, /* $port */) = explode(":", $host); $this->_host_dead[$ip] = time() + 30 + intval(rand(0, 10)); $this->_host_dead[$host] = $this->_host_dead[$ip]; @@ -1005,7 +1010,7 @@ class memcached return null; if (!$this->_connect_sock($sock, $host)) - return $this->_dead_sock($host); + return $this->_dead_host($host); // Do not buffer writes stream_set_write_buffer($sock, 0); -- 2.20.1