From 1c5071fd8af58377110c7f324232110988a59653 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 4 Dec 2015 23:15:36 -0800 Subject: [PATCH] Make ForkController destroy redis instances too Bug: T85565 Change-Id: I79e1b6aab30ef8ddfee2dd4f5f41e991562dbf13 --- includes/ForkController.php | 2 ++ includes/clientpool/RedisConnectionPool.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/includes/ForkController.php b/includes/ForkController.php index c1765e24e4..4a021ee1e5 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -153,7 +153,9 @@ class ForkController { wfGetLBFactory()->destroyInstance(); FileBackendGroup::destroySingleton(); LockManagerGroup::destroySingletons(); + JobQueueGroup::destroySingletons(); ObjectCache::clear(); + RedisConnectionPool::destroySingletons(); $wgMemc = null; } diff --git a/includes/clientpool/RedisConnectionPool.php b/includes/clientpool/RedisConnectionPool.php index 64db0d6efb..1b9f9b3cd1 100644 --- a/includes/clientpool/RedisConnectionPool.php +++ b/includes/clientpool/RedisConnectionPool.php @@ -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. * -- 2.20.1