Merge "resourceloader: Limit module_deps write lock to unique index"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 17 Feb 2017 21:32:29 +0000 (21:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 17 Feb 2017 21:32:29 +0000 (21:32 +0000)
includes/resourceloader/ResourceLoaderModule.php

index fd74a82..71e5939 100644 (file)
@@ -468,14 +468,14 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                try {
                        // If the list has been modified since last time we cached it, update the cache
                        if ( $localFileRefs !== $this->getFileDependencies( $context ) ) {
+                               $vary = $context->getSkin() . '|' . $context->getLanguage();
                                $cache = ObjectCache::getLocalClusterInstance();
-                               $key = $cache->makeKey( __METHOD__, $this->getName() );
+                               $key = $cache->makeKey( __METHOD__, $this->getName(), $vary );
                                $scopeLock = $cache->getScopedLock( $key, 0 );
                                if ( !$scopeLock ) {
                                        return; // T124649; avoid write slams
                                }
 
-                               $vary = $context->getSkin() . '|' . $context->getLanguage();
                                // Use relative paths to avoid ghost entries when $IP changes (T111481)
                                $deps = FormatJson::encode( self::getRelativePaths( $localFileRefs ) );
                                $dbw = wfGetDB( DB_MASTER );