summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SemanticState.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-04-19 17:46:03 +0000
committerAlan Conway <aconway@apache.org>2011-04-19 17:46:03 +0000
commit29fe430cef681c18fa1b4772a0424e9eb0a14567 (patch)
treeed8108cd1173179a7d28114e739e9b6f4c20a998 /cpp/src/qpid/broker/SemanticState.cpp
parentc66c6ed7c82f1d245ae958622c5f6aae7938a1d7 (diff)
downloadqpid-python-29fe430cef681c18fa1b4772a0424e9eb0a14567.tar.gz
QPID-3215: cached exchange reference can cause cluster inconsistencies if exchange is deleted/recreated
SemanticState::route() uses a simple cache variable to avoid looking up the exchange for every message. However if the exchange in question is deleted, even if then recreated, this can cause inconsistencies in a cluster. Even in a stand-alone broker messages can be routed by a deleted exchange because of the cache. Fix is to mark the exchange deleted and check the status when using the cached exchange. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1095144 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp
index ba1f989f7c..ce86253f4a 100644
--- a/cpp/src/qpid/broker/SemanticState.cpp
+++ b/cpp/src/qpid/broker/SemanticState.cpp
@@ -462,7 +462,7 @@ void SemanticState::route(intrusive_ptr<Message> msg, Deliverable& strategy) {
msg->setTimestamp(getSession().getBroker().getExpiryPolicy());
std::string exchangeName = msg->getExchangeName();
- if (!cacheExchange || cacheExchange->getName() != exchangeName)
+ if (!cacheExchange || cacheExchange->getName() != exchangeName || cacheExchange->isDestroyed())
cacheExchange = session.getBroker().getExchanges().get(exchangeName);
cacheExchange->setProperties(msg);