Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/230514
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/14/230514/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/230514
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: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits