Make ForkController destroy redis instances too
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 5 Dec 2015 07:15:36 +0000 (23:15 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 5 Dec 2015 07:17:37 +0000 (23:17 -0800)
Bug: T85565
Change-Id: I79e1b6aab30ef8ddfee2dd4f5f41e991562dbf13

includes/ForkController.php
includes/clientpool/RedisConnectionPool.php

index c1765e2..4a021ee 100644 (file)
@@ -153,7 +153,9 @@ class ForkController {
                wfGetLBFactory()->destroyInstance();
                FileBackendGroup::destroySingleton();
                LockManagerGroup::destroySingletons();
+               JobQueueGroup::destroySingletons();
                ObjectCache::clear();
+               RedisConnectionPool::destroySingletons();
                $wgMemc = null;
        }
 
index 64db0d6..1b9f9b3 100644 (file)
@@ -166,6 +166,14 @@ class RedisConnectionPool implements LoggerAwareInterface {
                return self::$instances[$id];
        }
 
+       /**
+        * Destroy all singleton() instances
+        * @since 1.27
+        */
+       public static function destroySingletons() {
+               self::$instances = array();
+       }
+
        /**
         * Get a connection to a redis server. Based on code in RedisBagOStuff.php.
         *