Add global limit to PoolCounter
authorGergő Tisza <tgr.huwiki@gmail.com>
Tue, 27 May 2014 21:16:40 +0000 (21:16 +0000)
committerGergő Tisza <tgr.huwiki@gmail.com>
Tue, 3 Jun 2014 19:28:35 +0000 (19:28 +0000)
commitd57273700bb1fd5f407028484206e17b06c7ccc2
treebfcbcaefc84c18c4d4fa50cf63af7f3ce88bdaea
parente696a662a96209e642fce66cb861ad18dc5a2371
Add global limit to PoolCounter

Adds a 'slot' option to $wgPoolCounterConf. When this option is set,
there are a limited number of slots for the given worker type,
regardless of key. Workers with the same key are still limited by
the 'workers' option.

The global limit is implemented by simply using a deterministic
hash of the key instead of the real key. This avoids deadlocks,
but results in slot underallocation due to hash collisions - even
when there are significantly more jobs that slots, some of the slots
might remain empty.

Bug: 65691
Change-Id: Ibdf8ec222f9756d70de2bed7ff14913351dc394b
includes/poolcounter/PoolCounter.php
tests/phpunit/includes/poolcounter/PoolCounterTest.php [new file with mode: 0644]