* When there is a read error, close the socket and mark the server dead,
instead of continuing to send requests through it, causing a protocol
violation.
* Also check for write errors.
* Increase the default stream and connect timeouts from 100ms to 500ms.
* Remove the commented-out _safe_fwrite() code that I wrote in 2005,
that PHP bug is fixed now, so writes can be handled the same way as
reads.
* Fix E_STRICT errors in get_multi() due to a resource being used as an
array index.
* For performance, flush the read buffer less often (only on persistent
connect).
* Move the fread() loop from _load_items() into its own new function.
* Be stricter about stripping expected newlines, don't just run trim() on
everything.
* Make MemCachedClientforWiki into a simple alias since the distinction
with MWMemcached was lost many years ago. We even renamed the class
"MWMemcached".
* Remove vim modeline made incorrect by 19d6293 (Nov 2009).
Change-Id: I81de31049b87038999e37054d8d174a782c78a68
MemcachedClient output a generic error message: "Error parsing memcached
response\n" whenever it is not able to read from the socket. It is also
lacking the remote peer it is reading from.
This patch add a new message when fgets( <socket> ) return false, which
means we could not read from the file pointer. It also get the stream
remote name for debugging purposes.
Change-Id: I9b8a25a03af0d730aa3b4830a44b1ea739343274
MemcachedClient output a generic error message: "Error parsing memcached
response\n" whenever it is not able to read from the socket. It is also
lacking the remote peer it is reading form.
This patch add a new message when fgets( <socket> ) return false and
attempt to get the remote peer address / port to append to the error
message. Might help us find out which memcached server is wild.
Change-Id: If918e824970aaa8231078e42fd28d31e8dd4e319
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.
Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;
Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
* Introduced a common base class for the two memcached clients, called
MemcachedBagOStuff.
* Moved the expiry time normalisation from MemcachedClient.php to
MemcachedBagOStuff since libmemcached needs the same workaround.
Change-Id: I507d4ec5a7fd863ae64a94f2c453981f9f03746c
When enabling memcached debug logs ($wgMemCachedDebug), they are
unconditionally sent to the main $wgDebugLogFile. This patch make it
possible to sent thoses specific log to an alternate file by setting
$wgDebugLogGroups['memcached']
Change-Id: I85d8ab92471ce3c31f8168dae83fe91e95e18dce
This reverts the SpecialCachedPage and formatDuration sagas, with some collateral damage here and there. All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
PHP fatal error in /usr/local/apache/common-local/php-1.18/includes/objectcache/MemcachedPhpBagOStuff.php line 91:
Call to undefined method MemCachedClientforWiki::lock()
* Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions).
* Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType.
* Made all object cache classes derive from BagOStuff.
* Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension.
* Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches.
* Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used.
* Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff.
* Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB.
* Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches.
* Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff.
* Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class.
* Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore
* Fixed spelling error in MWMemcached: persistant -> persistent