CSteipp has uploaded a new change for review.

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


Change subject: Add value to add() call when locking
......................................................................

Add value to add() call when locking

When BagOStuff::lock() was called, it called $this->add() with only
two parameters, the key and the timeout. But BagOStuff::add() takes
three parameters (key, value, timeout), so all locks got an infinite
timeout.

Change-Id: I82bed11b0b799f2cda13a8a0bd0cd94908b6ce8e
---
M includes/objectcache/BagOStuff.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/63150/1

diff --git a/includes/objectcache/BagOStuff.php 
b/includes/objectcache/BagOStuff.php
index 58ddd6a..e992f81 100644
--- a/includes/objectcache/BagOStuff.php
+++ b/includes/objectcache/BagOStuff.php
@@ -170,7 +170,7 @@
         */
        public function lock( $key, $timeout = 60 ) {
                $timestamp = microtime( true ); // starting UNIX timestamp
-               if ( $this->add( "{$key}:lock", $timeout ) ) {
+               if ( $this->add( "{$key}:lock", 'lock', $timeout ) ) {
                        return true;
                }
 
@@ -186,7 +186,7 @@
                                $sleep *= 2;
                        }
                        usleep( $sleep ); // back off
-                       $locked = $this->add( "{$key}:lock", $timeout );
+                       $locked = $this->add( "{$key}:lock", 'lock', $timeout );
                } while ( !$locked );
 
                return $locked;

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

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

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

Reply via email to