From: Domas Mituzas Date: Tue, 27 Oct 2009 07:26:43 +0000 (+0000) Subject: fix blacklist of dead servers X-Git-Tag: 1.31.0-rc.0~39086 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=cac2302f6b420f9cbd23f3350840829f193a1a2f;p=lhc%2Fweb%2Fwiklou.git fix blacklist of dead servers --- 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);