http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84728

Revision: 84728
Author:   tstarling
Date:     2011-03-25 03:30:44 +0000 (Fri, 25 Mar 2011)
Log Message:
-----------
Committing live patch to log memcached timeout errors

Modified Paths:
--------------
    branches/wmf/1.17wmf1/includes/objectcache/MemcachedClient.php

Modified: branches/wmf/1.17wmf1/includes/objectcache/MemcachedClient.php
===================================================================
--- branches/wmf/1.17wmf1/includes/objectcache/MemcachedClient.php      
2011-03-25 03:28:14 UTC (rev 84727)
+++ branches/wmf/1.17wmf1/includes/objectcache/MemcachedClient.php      
2011-03-25 03:30:44 UTC (rev 84728)
@@ -865,7 +865,17 @@
        function _load_items( $sock, &$ret ) {
                while ( 1 ) {
                        $decl = fgets( $sock );
-                       if ( $decl == "END\r\n" ) {
+                       if ( $decl === false ) {
+                               // PATCH: log timeout errors -- TS
+                               $info = stream_get_meta_data( $sock );
+                               if ( $info['timed_out'] ) {
+                                       wfDebugLog( 'memcached', "timeout\n" );
+                               } else {
+                                       wfDebugLog( 'memcached', "read error\n" 
);
+                               }
+                               $this->_close_sock( $sock );
+                               return false;
+                       } elseif ( $decl == "END\r\n" ) {
                                return true;
                        } elseif ( preg_match( '/^VALUE (\S+) (\d+) 
(\d+)\r\n$/', $decl, $match ) ) {
                                list( $rkey, $flags, $len ) = array( $match[1], 
$match[2], $match[3] );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to