From: Aaron Schulz Date: Mon, 19 Oct 2015 16:42:06 +0000 (-0700) Subject: More SquidUpdate cleanups X-Git-Tag: 1.31.0-rc.0~9351 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=733500556032a12c2e30730d850eb879f3a486d2;p=lhc%2Fweb%2Fwiklou.git More SquidUpdate cleanups * Remove $wgMaxSquidPurgeTitles; silently discarding URLs is the wrong way to limit things. The purge methods already batch, which HTCP pushing one at a time. Jobs already batch and have $wgJobBackoffThrottling. If code does purge 500 URLs at once with no limiting (flooding UDP), then it is already broken. * Make the HTCP method protected. * Rename $urlArr field. Change-Id: I17cced187fe7e93f5a5188022f12202a7746bdb7 --- diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index 835d38a316..2c64b2dc12 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -43,6 +43,7 @@ production. PasswordFactory themselves. ** A new constructor, User::newSystemUser(), has been added to simplify the creation of passwordless "system" users for logged actions. +* $wgMaxSquidPurgeTitles was removed. === New features in 1.27 === * $wgDataCenterId and $wgDataCenterRoles where added, which will serve as diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c21301f1b9..7b196cb3d8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2619,11 +2619,6 @@ $wgSquidServers = array(); */ $wgSquidServersNoPurge = array(); -/** - * Maximum number of titles to purge in any one client operation - */ -$wgMaxSquidPurgeTitles = 400; - /** * Whether to use a Host header in purge requests sent to the proxy servers * configured in $wgSquidServers. Set this to false to support Squid diff --git a/includes/deferred/SquidUpdate.php b/includes/deferred/SquidUpdate.php index 8d535b19c4..5f1552d637 100644 --- a/includes/deferred/SquidUpdate.php +++ b/includes/deferred/SquidUpdate.php @@ -26,25 +26,15 @@ * @ingroup Cache */ class SquidUpdate implements DeferrableUpdate { - /** - * Collection of URLs to purge. - * @var array - */ - protected $urlArr; + /** @var string[] Collection of URLs to purge */ + protected $urls = array(); /** * @param array $urlArr Collection of URLs to purge */ public function __construct( array $urlArr ) { - global $wgMaxSquidPurgeTitles; - // Remove duplicate URLs from list - $urlArr = array_unique( $urlArr ); - if ( count( $urlArr ) > $wgMaxSquidPurgeTitles ) { - // Truncate to desired maximum URL count - $urlArr = array_slice( $urlArr, 0, $wgMaxSquidPurgeTitles ); - } - $this->urlArr = $urlArr; + $this->urls = array_unique( $urlArr ); } /** @@ -77,7 +67,7 @@ class SquidUpdate implements DeferrableUpdate { * Purges the list of URLs passed to the constructor. */ public function doUpdate() { - self::purge( $this->urlArr ); + self::purge( $this->urls ); } /** @@ -136,7 +126,7 @@ class SquidUpdate implements DeferrableUpdate { * @throws MWException * @param array $urlArr Collection of URLs to purge */ - public static function HTCPPurge( $urlArr ) { + protected static function HTCPPurge( $urlArr ) { global $wgHTCPRouting, $wgHTCPMulticastTTL; // HTCP CLR operation