Avoid some possible deadlocks on account creation
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 27 Jul 2015 19:28:59 +0000 (12:28 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 18 Aug 2015 04:33:50 +0000 (21:33 -0700)
commit97c7a897c8a9c613ad7c6d977a2ebd7b48211ef0
tree2b15cc9ddd6f7337a569fa629b523a6f6a712cb2
parent6147de1182101903cf24259d61ec6ea34b907bf3
Avoid some possible deadlocks on account creation

* This uses a non-blocking $wgMemc lock to reserve the user
  name in question. This should prevent two threads from
  reaching LOCK IN SHARE MODE and getting stuck on INSERT.
  The lock is global to better cover auth plugins.
* This adds a BagOStuff::getScopedLock() convenience method.
  It uses less queries than LockManager by being EX only.
* Avoid extra lock attempt in lock() in non-blocking mode.
* Removed (un)lock() HashBagOStuff overrides that made it
  behave differently than other caches (wrt to re-entrance).

Bug: T106850
Change-Id: Iecf95206d712367f5d202f76ab0eaa9d7bdabf2b
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/HashBagOStuff.php
includes/specials/SpecialUserlogin.php
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/includes/objectcache/BagOStuffTest.php