diff --git a/RELEASE-NOTES-1.39 b/RELEASE-NOTES-1.39 index 45fd8ef47e2..89409fab2df 100644 --- a/RELEASE-NOTES-1.39 +++ b/RELEASE-NOTES-1.39 @@ -273,6 +273,7 @@ because of Phabricator reports. - ::getUserObj() → ::getUser() - ::setUserObj() → ::setUsername() - ::setUserIP() → ::setUsername() +* ObjectCache::addBusyCallback() is deprecated and non-functional. * … === Other changes in 1.39 === diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index 2706232f690..fc533f2adc4 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -520,22 +520,12 @@ abstract class BagOStuff implements /** * Let a callback be run to avoid wasting time on special blocking calls * - * The callbacks may or may not be called ever, in any particular order. - * They are likely to be invoked when something WRITE_SYNC is used used. - * They should follow a caching pattern as shown below, so that any code - * using the work will get it's result no matter what happens. - * @code - * $result = null; - * $workCallback = function () use ( &$result ) { - * if ( !$result ) { - * $result = .... - * } - * return $result; - * } - * @endcode + * This is hard-deprecated and non-functional since 1.39. The callback + * will not be called. * * @param callable $workCallback * @since 1.28 + * @deprecated since 1.39 */ abstract public function addBusyCallback( callable $workCallback ); diff --git a/includes/libs/objectcache/MediumSpecificBagOStuff.php b/includes/libs/objectcache/MediumSpecificBagOStuff.php index 16fd3516c9f..71f5191f00c 100644 --- a/includes/libs/objectcache/MediumSpecificBagOStuff.php +++ b/includes/libs/objectcache/MediumSpecificBagOStuff.php @@ -48,9 +48,6 @@ abstract class MediumSpecificBagOStuff extends BagOStuff { /** @var bool */ private $dupeTrackScheduled = false; - /** @var callable[] */ - protected $busyCallbacks = []; - /** @var array[] Map of (key => (PHP variable value, serialized value)) */ protected $preparedValues = []; @@ -805,7 +802,7 @@ abstract class MediumSpecificBagOStuff extends BagOStuff { } final public function addBusyCallback( callable $workCallback ) { - $this->busyCallbacks[] = $workCallback; + wfDeprecated( __METHOD__, '1.39' ); } /** diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 1f922e48f08..386fa168fc5 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -32,7 +32,6 @@ use Wikimedia\Rdbms\ILoadBalancer; use Wikimedia\Rdbms\IMaintainableDatabase; use Wikimedia\ScopedCallback; use Wikimedia\Timestamp\ConvertibleTimestamp; -use Wikimedia\WaitConditionLoop; /** * RDBMS-based caching module @@ -1835,15 +1834,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return true; // not applicable } - $loop = new WaitConditionLoop( - static function () use ( $lb, $primaryPos ) { - return $lb->waitForAll( $primaryPos, 1 ); - }, - $this->syncTimeout, - $this->busyCallbacks - ); - - return ( $loop->invoke() === $loop::CONDITION_REACHED ); + return $lb->waitForAll( $primaryPos, $this->syncTimeout ); } catch ( DBError $e ) { $this->setAndLogDBError( $e );