Index: branches/wmf/1.17wmf1/includes/objectcache/MemcachedClient.php |
— | — | @@ -865,7 +865,17 @@ |
866 | 866 | function _load_items( $sock, &$ret ) { |
867 | 867 | while ( 1 ) { |
868 | 868 | $decl = fgets( $sock ); |
869 | | - if ( $decl == "END\r\n" ) { |
| 869 | + if ( $decl === false ) { |
| 870 | + // PATCH: log timeout errors -- TS |
| 871 | + $info = stream_get_meta_data( $sock ); |
| 872 | + if ( $info['timed_out'] ) { |
| 873 | + wfDebugLog( 'memcached', "timeout\n" ); |
| 874 | + } else { |
| 875 | + wfDebugLog( 'memcached', "read error\n" ); |
| 876 | + } |
| 877 | + $this->_close_sock( $sock ); |
| 878 | + return false; |
| 879 | + } elseif ( $decl == "END\r\n" ) { |
870 | 880 | return true; |
871 | 881 | } elseif ( preg_match( '/^VALUE (\S+) (\d+) (\d+)\r\n$/', $decl, $match ) ) { |
872 | 882 | list( $rkey, $flags, $len ) = array( $match[1], $match[2], $match[3] ); |