r107590 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107589‎ | r107590 | r107591 >
Date:19:33, 29 December 2011
Author:khorn
Status:ok
Tags:
Comment:
Building in some redundancy in the part that collides stomp messages and antimessages, due to some very occasional instability we have encountered in ActiveMQ.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
@@ -59,7 +59,19 @@
6060 $this->handled_ids = array();
6161
6262 //first, we need to... clean up the limbo queue.
63 - $this->handleStompAntiMessages();
 63+
 64+ //building in some redundancy here.
 65+ $keepGoing = true;
 66+ $am_called_count = 0;
 67+ while ( $keepGoing ){
 68+ $antimessageCount = $this->handleStompAntiMessages();
 69+ $am_called_count += 1;
 70+ if ( $antimessageCount === 0 ){
 71+ $keepGoing = false;
 72+ } else {
 73+ sleep(2); //two seconds.
 74+ }
 75+ }
6476 $this->adapter->log( 'Removed ' . $this->removed_message_count . ' messages and antimessages.' );
6577
6678 if ( $this->keepGoing() ){
@@ -101,7 +113,7 @@
102114 }
103115 }
104116 $final = "\nDone! Final results: \n";
105 - $final .= " $am destroyed via antimessage \n";
 117+ $final .= " $am destroyed via antimessage (called $am_called_count times) \n";
106118 $final .= " $rec rectified orphans \n";
107119 $final .= " $err errored out \n";
108120 if ( isset( $this->adapter->orphanstats ) ){
@@ -166,6 +178,7 @@
167179 }
168180 $this->addStompCorrelationIDToAckBucket( false, true ); //this just acks everything that's waiting for it.
169181 $this->adapter->log("Found $count antimessages.");
 182+ return $count;
170183 }
171184
172185 /**

Status & tagging log