Aaron Schulz has uploaded a new change for review.

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

Change subject: Fix broken wincache merge() implementation
......................................................................

Fix broken wincache merge() implementation

Bug: T145664
Change-Id: I2f841779108df281e24003c586775b71aa176909
---
M includes/libs/objectcache/WinCacheBagOStuff.php
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/310809/1

diff --git a/includes/libs/objectcache/WinCacheBagOStuff.php 
b/includes/libs/objectcache/WinCacheBagOStuff.php
index 19cc66a..6996ce5 100644
--- a/includes/libs/objectcache/WinCacheBagOStuff.php
+++ b/includes/libs/objectcache/WinCacheBagOStuff.php
@@ -65,6 +65,13 @@
        }
 
        public function merge( $key, callable $callback, $exptime = 0, 
$attempts = 10, $flags = 0 ) {
-               return $this->mergeViaCas( $key, $callback, $exptime, $attempts 
);
+               if ( wincache_lock( $key ) ) { // optimize with FIFO lock
+                       $ok = $this->mergeViaLock( $key, $callback, $exptime, 
$attempts, $flags );
+                       wincache_unlock( $key );
+               } else {
+                       $ok = false;
+               }
+
+               return $ok;
        }
 }

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

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

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

Reply via email to