r58183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58182‎ | r58183 | r58184 >
Date:07:26, 27 October 2009
Author:midom
Status:ok
Tags:
Comment:
fix blacklist of dead servers
Modified paths:
  • /trunk/phase3/includes/memcached-client.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/memcached-client.php
@@ -737,6 +737,11 @@
738738 function _dead_sock ($sock)
739739 {
740740 $host = array_search($sock, $this->_cache_sock);
 741+ $this->_dead_host($host);
 742+ }
 743+
 744+ function _dead_host ($host)
 745+ {
741746 @list ($ip, /* $port */) = explode(":", $host);
742747 $this->_host_dead[$ip] = time() + 30 + intval(rand(0, 10));
743748 $this->_host_dead[$host] = $this->_host_dead[$ip];
@@ -1005,7 +1010,7 @@
10061011 return null;
10071012
10081013 if (!$this->_connect_sock($sock, $host))
1009 - return $this->_dead_sock($host);
 1014+ return $this->_dead_host($host);
10101015
10111016 // Do not buffer writes
10121017 stream_set_write_buffer($sock, 0);

Status & tagging log