Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73546
Change subject: Logging in the STOMP dequeue loop
......................................................................
Logging in the STOMP dequeue loop
Change-Id: Idc2beb54a4d69b5eab46f7e2d71117fd2d555ca4
---
M sites/all/modules/wmf_common/queue.php
1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/46/73546/1
diff --git a/sites/all/modules/wmf_common/queue.php
b/sites/all/modules/wmf_common/queue.php
index 8dca757..5a971f8 100644
--- a/sites/all/modules/wmf_common/queue.php
+++ b/sites/all/modules/wmf_common/queue.php
@@ -30,7 +30,9 @@
$processed = 0;
for ( $i = 0; $i < $batch_size; $i++ ) {
// we could alternatively set a time limit on the stomp readframe
- set_time_limit( 10 );
+ $timeLimit = 10;
+ set_time_limit( $timeLimit );
+ watchdog('wmf_common', t('Waiting at most %wait seconds for an
incoming message...', array( '%wait' => $timeLimit )));
$msg = $con->readFrame();
if ( empty($msg) ) {
return FALSE;
@@ -45,7 +47,9 @@
(intval($msg->headers['delay_till']) > time())
) {
// We have a message that we are not supposed to process yet, So
requeue and ack
+ watchdog('wmf_common', t('Attempting to requeue message'));
if( wmf_common_stomp_requeue($msg) ) {
+ watchdog('wmf_common', t('Ack\'ing message'));
wmf_common_stomp_ack_frame($msg);
} else {
throw new WmfException("STOMP_BAD_CONNECTION", "Failed to
requeue a delayed message");
@@ -54,7 +58,8 @@
// If we're seeing messages with the current transaction ID in it
we've started to eat our own
// tail. So... we should bounce out.
if (strpos($msg->headers['message-id'],
wmf_common_stomp_get_session_id()) === 0) {
- break;
+ watchdog('wmf_common', t('Ending dequeue loop, own tail
detected'));
+ break ;
} else {
continue;
}
@@ -65,10 +70,13 @@
if ($success === TRUE) {
$processed++;
} else {
+ watchdog('wmf_common', t('Ending dequeue loop, processing a
message failed'));
break;
}
}
+ watchdog('wmf_common', t('Disconnecting from %queue queue', array(
'%queue' => $queue )));
+
$con->unsubscribe( $queue );
$con->disconnect();
--
To view, visit https://gerrit.wikimedia.org/r/73546
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc2beb54a4d69b5eab46f7e2d71117fd2d555ca4
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits