dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47838df
)
objectcache: avoid duplicate set() calls with lockTSE when no value is in cache
author
Aaron Schulz
<aschulz@wikimedia.org>
Sun, 3 Feb 2019 02:13:17 +0000
(18:13 -0800)
committer
Aaron Schulz
<aschulz@wikimedia.org>
Sun, 3 Feb 2019 02:17:59 +0000
(
02:17
+0000)
Each thread will still run the callback, but only one will save the value back
Bug: T203786
Change-Id: Idc4738aa005cc44ec0f1adc6dcf2e3f87d0c9480
includes/libs/objectcache/WANObjectCache.php
patch
|
blob
|
history
diff --git
a/includes/libs/objectcache/WANObjectCache.php
b/includes/libs/objectcache/WANObjectCache.php
index
6e8d266
..
88f87f8
100644
(file)
--- a/
includes/libs/objectcache/WANObjectCache.php
+++ b/
includes/libs/objectcache/WANObjectCache.php
@@
-1334,7
+1334,8
@@
class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
$this->setInterimValue( $key, $wrapped, $tempTTL );
}
- if ( $valueIsCacheable ) {
+ // Save the value unless a mutex-winning thread is already expected to do that
+ if ( $valueIsCacheable && ( !$useMutex || $lockAcquired ) ) {
$setOpts['lockTSE'] = $lockTSE;
$setOpts['staleTTL'] = $staleTTL;
// Use best known "since" timestamp if not provided