Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/233401

Change subject: Don't look at more than (15 * chunk size * batch size) changes 
in ChangeDispatcher
......................................................................

Don't look at more than (15 * chunk size * batch size) changes in 
ChangeDispatcher

That keeps the dispatcher from taking ages to dispatch to a certain wiki,
yet it can still look through a considerable amount of changes.

Bug: T105592
Change-Id: I220be482032de8b148e669c4bc6aeaafdcffe5c6
---
M repo/includes/ChangeDispatcher.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/01/233401/1

diff --git a/repo/includes/ChangeDispatcher.php 
b/repo/includes/ChangeDispatcher.php
index 9bd7563..83d5393 100644
--- a/repo/includes/ChangeDispatcher.php
+++ b/repo/includes/ChangeDispatcher.php
@@ -276,12 +276,13 @@
                $batch = array();
                $batchSize = 0;
                $chunkSize = $this->batchSize * $this->batchChunkFactor;
+               $chunksExamined = 0;
 
                // Track the change ID from which the next pass should start.
                // Note that this is non-trivial due to programmatic filtering.
                $lastIdSeen = $after;
 
-               while ( $batchSize < $this->batchSize ) {
+               while ( $batchSize < $this->batchSize && $chunksExamined < 15 ) 
{
                        // get a chunk of changes
                        $chunk = $this->chunkedChangesAccess->loadChunk( 
$after+1, $chunkSize );
 
@@ -300,6 +301,7 @@
 
                        $batch = array_merge( $batch, $filtered );
                        $batchSize = count( $batch );
+                       $chunksExamined++;
 
                        //XXX: We could try to adapt $chunkSize based on ratio 
of changes that get filtered out:
                        //     $chunkSize = ( $this->batchSize - count( $batch 
) ) * ( count_before / count_after );

-- 
To view, visit https://gerrit.wikimedia.org/r/233401
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I220be482032de8b148e669c4bc6aeaafdcffe5c6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.26wmf19
Gerrit-Owner: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Hoo man <h...@online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to