From 105190c196b37637c6f1eb8d7081457c4bd67716 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 9 Jan 2014 22:12:25 +0000 Subject: 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 --- qpid/cpp/src/qpid/broker/Bridge.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src') 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); } -- cgit v1.2.1