summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-11-13 12:43:26 +0000
committerGordon Sim <gsim@apache.org>2008-11-13 12:43:26 +0000
commitd89b4c3eb46f7aefd50b67a5de13d290b5ded7af (patch)
treedc326d23b052176418268da17ef6262cc15f9644
parentb15caaa061091efcecfd1e8704e6f2c6bde4e03e (diff)
downloadqpid-python-d89b4c3eb46f7aefd50b67a5de13d290b5ded7af.tar.gz
QPID-1414: fix to prevent concurrent modification of brokers known url list
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@713714 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/Broker.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp
index 3ba2e70bc2..31f1767f63 100644
--- a/qpid/cpp/src/qpid/broker/Broker.cpp
+++ b/qpid/cpp/src/qpid/broker/Broker.cpp
@@ -239,6 +239,13 @@ Broker::Broker(const Broker::Options& conf) :
if (conf.queueCleanInterval) {
queueCleaner.start(conf.queueCleanInterval * qpid::sys::TIME_SEC);
}
+
+ //initialize known broker urls:
+ try {
+ knownBrokers.push_back ( qpid::Url::getIpAddressesUrl ( getPort(TCP_TRANSPORT) ) );
+ } catch (const NoSuchTransportException& e) {
+ QPID_LOG(error, "Could not send client known broker urls for cluster: " << e.what());
+ }
}
void Broker::declareStandardExchange(const std::string& name, const std::string& type)
@@ -430,13 +437,7 @@ boost::shared_ptr<sys::Poller> Broker::getPoller() { return poller; }
std::vector<Url>
Broker::getKnownBrokersImpl()
{
- knownBrokers.clear();
- try {
- knownBrokers.push_back ( qpid::Url::getIpAddressesUrl ( getPort(TCP_TRANSPORT) ) );
- } catch (const NoSuchTransportException& e) {
- QPID_LOG(error, "Could not send client known broker urls for cluster: " << e.what());
- }
- return knownBrokers;
+ return knownBrokers;
}
const std::string Broker::TCP_TRANSPORT("tcp");