summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-12-11 15:03:29 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-12-11 15:03:29 +0000
commite8e44b32794658553c2f08786cf80f634edba3f9 (patch)
tree6f6adae3ba37efbd67230477857560db7459210c
parent3bc7e889caef716d8fdd8006f2d53b821ecef6c1 (diff)
downloadqpid-python-e8e44b32794658553c2f08786cf80f634edba3f9.tar.gz
QPID-2263 : Stop Exceptions killing the HouseKeeping thread. Also prevented Deleted Messages from being processed by the notification checks.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@889645 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java27
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java5
2 files changed, 23 insertions, 9 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
index 3d5d99f0b0..825aa9795e 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
@@ -1689,15 +1689,28 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener
while (queueListIterator.advance())
{
QueueEntry node = queueListIterator.getNode();
- if (!node.isDeleted() && node.expired() && node.acquire())
+ // Only process nodes that are not currently deleted
+ if (!node.isDeleted())
{
- dequeueEntry(node);
- }
- else
- {
- if(_managedObject!=null)
+ // If the node has exired then aquire it
+ if (node.expired() && node.acquire())
+ {
+ // Then dequeue it.
+ dequeueEntry(node);
+ }
+ else
{
- _managedObject.checkForNotification(node.getMessage());
+ if (_managedObject != null)
+ {
+ // There is a chance that the node could be deleted by
+ // the time the check actually occurs. So verify we
+ // can actually get the message to perform the check.
+ ServerMessage msg = node.getMessage();
+ if (msg != null)
+ {
+ _managedObject.checkForNotification(msg);
+ }
+ }
}
}
}
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
index 6826dcf324..78deeeb164 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
@@ -268,10 +268,11 @@ public class VirtualHostImpl implements Accessable, VirtualHost
{
q.checkMessageStatus();
}
- catch (AMQException e)
+ catch (Exception e)
{
_logger.error("Exception in housekeeping for queue: " + q.getName().toString(), e);
- throw new RuntimeException(e);
+ //Don't throw exceptions as this will stop the
+ // house keeping task from running.
}
}
}