From: Aaron Schulz Date: Sat, 5 Dec 2015 07:15:36 +0000 (-0800) Subject: Make ForkController destroy redis instances too X-Git-Tag: 1.31.0-rc.0~8792^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=1c5071fd8af58377110c7f324232110988a59653;p=lhc%2Fweb%2Fwiklou.git Make ForkController destroy redis instances too Bug: T85565 Change-Id: I79e1b6aab30ef8ddfee2dd4f5f41e991562dbf13 --- 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. *