Aaron Schulz has submitted this change and it was merged.
Change subject: Pass a limit to BackLinkCache::getNumLinks() in some places to
avoid OOMs.
......................................................................
Pass a limit to BackLinkCache::getNumLinks() in some places to avoid OOMs.
Change-Id: Idf1042c083837a9e4a380bb20ecdf3043ea9ab09
(cherry picked from commit 97b66aef1728ba9f978dc55411a9400cd86b9b2f)
---
M includes/job/jobs/HTMLCacheUpdateJob.php
M includes/job/jobs/RefreshLinksJob.php
2 files changed, 3 insertions(+), 2 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/job/jobs/HTMLCacheUpdateJob.php
b/includes/job/jobs/HTMLCacheUpdateJob.php
index 9d88a47..72561d0 100644
--- a/includes/job/jobs/HTMLCacheUpdateJob.php
+++ b/includes/job/jobs/HTMLCacheUpdateJob.php
@@ -82,7 +82,8 @@
global $wgMaxBacklinksInvalidate;
# Get an estimate of the number of rows from the BacklinkCache
- $numRows = $this->blCache->getNumLinks( $this->params['table']
);
+ $max = max( $this->rowsPerJob * 2, $wgMaxBacklinksInvalidate )
+ 1;
+ $numRows = $this->blCache->getNumLinks( $this->params['table'],
$max );
if ( $wgMaxBacklinksInvalidate !== false && $numRows >
$wgMaxBacklinksInvalidate ) {
wfDebug( "Skipped HTML cache invalidation of
{$this->title->getPrefixedText()}." );
return true;
diff --git a/includes/job/jobs/RefreshLinksJob.php
b/includes/job/jobs/RefreshLinksJob.php
index 9dbe827..2ba855d 100644
--- a/includes/job/jobs/RefreshLinksJob.php
+++ b/includes/job/jobs/RefreshLinksJob.php
@@ -158,7 +158,7 @@
$jobs = array_merge( $jobs, $this->getSingleTitleJobs(
$table, $masterPos ) );
} else {
# This is a base job to trigger the insertion of
partitioned jobs...
- if ( $tbc->getNumLinks( $table ) <= $wgUpdateRowsPerJob
) {
+ if ( $tbc->getNumLinks( $table, $wgUpdateRowsPerJob + 1
) <= $wgUpdateRowsPerJob ) {
# Just directly insert the single per-title jobs
$jobs = array_merge( $jobs,
$this->getSingleTitleJobs( $table, $masterPos ) );
} else {
--
To view, visit https://gerrit.wikimedia.org/r/59874
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idf1042c083837a9e4a380bb20ecdf3043ea9ab09
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf2
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits