BagOStuff: Optionally log duplicate key lookups
authorBryan Davis <bd808@wikimedia.org>
Wed, 2 Mar 2016 02:25:55 +0000 (19:25 -0700)
committerBryanDavis <bdavis@wikimedia.org>
Fri, 22 Apr 2016 04:21:20 +0000 (04:21 +0000)
commit450bb6723da128eb5aa90151cbd8fda34dbb9118
tree6e5e61d0a39bdc3d46fa9514239da0c8db368d99
parenta0803c9bc551631c8a35bf2d99705a724cb62039
BagOStuff: Optionally log duplicate key lookups

Add new 'reportDupes' parameter to BagOStuff. This parameter enables scheduling
of a callback after the current web request ends. This callback will emit warning
log messages for all keys that were requested more than once.

The default ObjectCache factory for MediaWiki enables this option by default.
Not by default for plain BagOStuff instances, however. E.g. `new HashBagOStuff()`.

It also set 'asyncHandler' for all classes now (not just MultiWriteBagOStuff).

Bug: T128125
Co-Authored-By: Timo Tijhof <krinklemail@gmail.com>
Change-Id: I8a2b06cf54d2acf5950eed71756ecdf50e224be1
includes/DefaultSettings.php
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/MultiWriteBagOStuff.php
includes/objectcache/ObjectCache.php
tests/phpunit/includes/libs/objectcache/BagOStuffTest.php