summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2014-01-09 22:12:25 +0000
committerAlan Conway <aconway@apache.org>2014-01-09 22:12:25 +0000
commit105190c196b37637c6f1eb8d7081457c4bd67716 (patch)
tree78ccb1be1261083eb2b2d16a7b123240d9572000 /qpid/cpp/src
parentf05a68597934004986f051fb7a02a519d7cce3dd (diff)
downloadqpid-python-105190c196b37637c6f1eb8d7081457c4bd67716.tar.gz
QPID-5454: Sporadic core dump in ha_tests.ReplicationTests.test_auto_delete_failover
Due to race condition Bridge::cancel using a deleted Connection object. If the bridge is being cancelled because it is about to be created on a new connection, then it should not attempt to send a cancel to the remote peer since that connection is no longer valid. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1556966 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/Bridge.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/Bridge.cpp b/qpid/cpp/src/qpid/broker/Bridge.cpp
index b7fbb1a9aa..06d3a0dd52 100644
--- a/qpid/cpp/src/qpid/broker/Bridge.cpp
+++ b/qpid/cpp/src/qpid/broker/Bridge.cpp
@@ -200,9 +200,10 @@ void Bridge::create(amqp_0_10::Connection& c)
if (args.i_srcIsLocal) sessionHandler.getSession()->enableReceiverTracking();
}
-void Bridge::cancel(amqp_0_10::Connection&)
+void Bridge::cancel(amqp_0_10::Connection& c)
{
- if (resetProxy()) {
+ // If &c != conn then we have failed over so the old connection is closed.
+ if (&c == conn && resetProxy()) {
peer->getMessage().cancel(args.i_dest);
peer->getSession().detach(sessionName);
}