Aude has uploaded a new change for review.

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

Change subject: Update Wikidata - add limit for pending changes in dispatcher
......................................................................

Update Wikidata - add limit for pending changes in dispatcher

This limits the number of passes per wiki, when selecting pending
changes for dispatch.

Sometimes 0 changes are found for a small wiki and the dispatcher
can get stuck in a loop until it finds enough to dispatch to that
wiki.

Bug: T105592
Change-Id: If822cd3091cfceab52f2aab80d1a06e97b70b544
---
M composer.lock
M extensions/Wikibase/repo/includes/ChangeDispatcher.php
M vendor/composer/installed.json
3 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata 
refs/changes/11/233411/1

diff --git a/composer.lock b/composer.lock
index 43ade12..de31a86 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1379,7 +1379,7 @@
             "source": {
                 "type": "git",
                 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase";,
-                "reference": "1981ec428ebe0d59ffd52b1003945161f45fee0e"
+                "reference": "b607ec094cecf02c937a9ddbe8f48c4c046185f7"
             },
             "require": {
                 "data-values/common": "~0.3.0",
@@ -1461,7 +1461,7 @@
                 "issues": "https://phabricator.wikimedia.org/";,
                 "irc": "irc://irc.freenode.net/wikidata"
             },
-            "time": "2015-08-19 18:22:18"
+            "time": "2015-08-24 14:00:06"
         },
         {
             "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/repo/includes/ChangeDispatcher.php 
b/extensions/Wikibase/repo/includes/ChangeDispatcher.php
index 9bd7563..83d5393 100644
--- a/extensions/Wikibase/repo/includes/ChangeDispatcher.php
+++ b/extensions/Wikibase/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 );
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index a1ed104..ca09130 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1467,7 +1467,7 @@
         "source": {
             "type": "git",
             "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase";,
-            "reference": "1981ec428ebe0d59ffd52b1003945161f45fee0e"
+            "reference": "b607ec094cecf02c937a9ddbe8f48c4c046185f7"
         },
         "require": {
             "data-values/common": "~0.3.0",
@@ -1497,7 +1497,7 @@
         "require-dev": {
             "squizlabs/php_codesniffer": "~2.1"
         },
-        "time": "2015-08-19 18:20:33",
+        "time": "2015-08-10 11:08:57",
         "type": "mediawiki-extension",
         "installation-source": "source",
         "autoload": {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If822cd3091cfceab52f2aab80d1a06e97b70b544
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: wmf/1.26wmf19
Gerrit-Owner: Aude <aude.w...@gmail.com>

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

Reply via email to