jenkins-bot has submitted this change and it was merged. Change subject: Reject isRequeue messages after expiry ......................................................................
Reject isRequeue messages after expiry FIXME: configurable variables are kinda lying. Should replace max retries with max age. Bug: T142028 Change-Id: I77293f7832f8624a386b815a35307a206033f316 --- M sites/all/modules/wmf_common/WmfQueueConsumer.php 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_common/WmfQueueConsumer.php b/sites/all/modules/wmf_common/WmfQueueConsumer.php index 9a1fc49..081db09 100644 --- a/sites/all/modules/wmf_common/WmfQueueConsumer.php +++ b/sites/all/modules/wmf_common/WmfQueueConsumer.php @@ -42,11 +42,18 @@ $message, WmfException $ex, $correlationId ) { $mailableDetails = ''; + $reject = false; if ( $ex->isRequeue() ) { $delay = intval( variable_get( 'wmf_common_requeue_delay', 20 * 60 ) ); - $retryDate = time() + $delay; - $this->sendToDamagedStore( $message, $ex, $retryDate ); + $maxTries = intval( variable_get( 'wmf_common_requeue_max', 10 ) ); + $ageLimit = $delay * $maxTries; + if ( $message['date'] + $ageLimit < time() ) { + $reject = true; + } else { + $retryDate = time() + $delay; + $this->sendToDamagedStore( $message, $ex, $retryDate ); + } } if ( $ex->isDropMessage() ) { @@ -56,7 +63,7 @@ NULL, WATCHDOG_ERROR ); - } elseif ( $ex->isRejectMessage() ) { + } elseif ( $ex->isRejectMessage() || $reject ) { $messageString = json_encode( $message ); watchdog( 'wmf_common', -- To view, visit https://gerrit.wikimedia.org/r/306450 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77293f7832f8624a386b815a35307a206033f316 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: Awight <awi...@wikimedia.org> Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits