Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/232536

Change subject: T109183: We already have a lock
......................................................................

T109183: We already have a lock

Change-Id: Ie107b87385243bb44d3ecc1ae3ca025fdeb04275
---
M includes/cache/MessageCache.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/232536/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 7945c8b..a7c9cda 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -231,7 +231,7 @@
         * @throws MWException
         * @return bool
         */
-       function load( $code = false, $mode = null ) {
+       function load( $code = false, $mode = null, $locked = false ) {
                global $wgUseLocalMessageCache;
 
                if ( !is_string( $code ) ) {
@@ -327,7 +327,7 @@
                                # We need to call loadFromDB. Limit the 
concurrency to one process.
                                # This prevents the site from going down when 
the cache expires.
                                # Note that the slam-protection lock here is 
non-blocking.
-                               if ( $this->loadFromDBWithLock( $code, $where ) 
) {
+                               if ( $locked ? $this->loadFromDB( $code ) : 
$this->loadFromDBWithLock( $code, $where ) ) {
                                        $success = true;
                                        break;
                                } elseif ( $staleCache ) {
@@ -558,7 +558,7 @@
 
                $cacheKey = wfMemcKey( 'messages', $code );
                $this->lock( $cacheKey );
-               $this->load( $code, self::FOR_UPDATE );
+               $this->load( $code, self::FOR_UPDATE, true );
 
                $titleKey = wfMemcKey( 'messages', 'individual', $title );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/232536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie107b87385243bb44d3ecc1ae3ca025fdeb04275
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to