Fixed pecl memcached client in persistent mode.
authorAaron <aschulz@wikimedia.org>
Thu, 14 Jun 2012 01:08:38 +0000 (18:08 -0700)
committerAaron <aschulz@wikimedia.org>
Thu, 14 Jun 2012 01:19:33 +0000 (18:19 -0700)
commit396be409e25636c303b7814c4e37fcb3fc50f046
tree78fb39b4ce385cde5bdaba786f57f240c9e9a9da
parent15e5193a19fb55339e60d192142dfd7c2e546596
Fixed pecl memcached client in persistent mode.

* When using a persistend ID in the constructor, the object is effectively shared among
  the callers using that ID. If we always use __CLASS__, then this breaks when different
  BagOStuffs may be used. Instead, a hash of the settings is now used.
  See http://www.php.net/manual/en/memcached.construct.php.
* Don't keep adding servers to the pool, as the object is shared among callers. Once one thread
  initializes the object, it will already be initialized by the next thread. Calling addSever()
  again will cause an increasing number of duplicate servers to exist in the data structure, and
  thus an increasing number of socket connections over time.
* Also, use addServers() instead of multiple addServer() calls per
  http://www.php.net/manual/en/memcached.addserver.php.

Change-Id: I0e7510320cb79d9f152e8958ddd50400fa9da37f
includes/objectcache/MemcachedPeclBagOStuff.php