Made pool counter better handled nested calls
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 5 Jun 2014 22:21:32 +0000 (15:21 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 5 Jun 2014 22:21:32 +0000 (15:21 -0700)
* This is useful for the "GetLocalFileCopy" pool for example.

Change-Id: Ie9f092fb595d12ebc6548571cecbd2f4251297db

includes/poolcounter/PoolCounterWork.php

index 523e9e0..1bc1a8b 100644 (file)
@@ -112,6 +112,10 @@ abstract class PoolCounterWork {
                }
 
                switch ( $status->value ) {
+                       case PoolCounter::LOCK_HELD:
+                               // Better to ignore nesting pool counter limits than to fail.
+                               // Assume that the outer pool limiting is reasonable enough.
+                               /* no break */
                        case PoolCounter::LOCKED:
                                $result = $this->doWork();
                                $this->poolCounter->release();