jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/objectcache/BagOStuff.php 
b/includes/objectcache/BagOStuff.php
index 58ddd6a..857943e 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", 1, $timeout ) ) {
                        return true;
                }
 
@@ -186,7 +186,7 @@
                                $sleep *= 2;
                        }
                        usleep( $sleep ); // back off
-                       $locked = $this->add( "{$key}:lock", $timeout );
+                       $locked = $this->add( "{$key}:lock", 1, $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: merged
Gerrit-Change-Id: I82bed11b0b799f2cda13a8a0bd0cd94908b6ce8e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to