diff options
-rw-r--r-- | cpp/src/qpid/broker/SignalHandler.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/SignalHandler.h | 3 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 3 | ||||
-rw-r--r-- | cpp/src/tests/PartialFailure.cpp | 6 |
4 files changed, 10 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/SignalHandler.cpp b/cpp/src/qpid/broker/SignalHandler.cpp index f4a3822554..b565cfd419 100644 --- a/cpp/src/qpid/broker/SignalHandler.cpp +++ b/cpp/src/qpid/broker/SignalHandler.cpp @@ -38,6 +38,8 @@ void SignalHandler::setBroker(const boost::intrusive_ptr<Broker>& b) { signal(SIGCHLD,SIG_IGN); } +void SignalHandler::shutdown() { shutdownHandler(0); } + void SignalHandler::shutdownHandler(int) { if (broker.get()) { broker->shutdown(); diff --git a/cpp/src/qpid/broker/SignalHandler.h b/cpp/src/qpid/broker/SignalHandler.h index d2cdfae07c..bbe831b61d 100644 --- a/cpp/src/qpid/broker/SignalHandler.h +++ b/cpp/src/qpid/broker/SignalHandler.h @@ -38,6 +38,9 @@ class SignalHandler /** Set the broker to be shutdown on signals */ static void setBroker(const boost::intrusive_ptr<Broker>& broker); + /** Initiate shut-down of broker */ + static void shutdown(); + private: static void shutdownHandler(int); static boost::intrusive_ptr<Broker> broker; diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index d440068781..0706fc72e8 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -99,6 +99,7 @@ #include "qpid/broker/Connection.h" #include "qpid/broker/QueueRegistry.h" #include "qpid/broker/SessionState.h" +#include "qpid/broker/SignalHandler.h" #include "qpid/framing/AMQFrame.h" #include "qpid/framing/AMQP_AllOperations.h" #include "qpid/framing/AllInvoker.h" @@ -311,7 +312,7 @@ void Cluster::leave(Lock&) { // Finalize connections now now to avoid problems later in destructor. LEAVE_TRY(localConnections.clear()); LEAVE_TRY(connections.clear()); - LEAVE_TRY(broker.shutdown()); + LEAVE_TRY(broker::SignalHandler::shutdown()); } } diff --git a/cpp/src/tests/PartialFailure.cpp b/cpp/src/tests/PartialFailure.cpp index 08c326cd02..5de8ecb189 100644 --- a/cpp/src/tests/PartialFailure.cpp +++ b/cpp/src/tests/PartialFailure.cpp @@ -93,7 +93,7 @@ QPID_AUTO_TEST_CASE(testCoincidentErrors) { c0.session.queueDeclare("q", durable=true); { - // ScopedSuppressLogging allQuiet; + ScopedSuppressLogging allQuiet; async(c0.session).messageTransfer(content=pMessage("TEST_STORE_DO: s0[exception]", "q")); async(c1.session).messageTransfer(content=pMessage("TEST_STORE_DO: s1[exception]", "q")); @@ -118,7 +118,7 @@ QPID_AUTO_TEST_CASE(testNormalErrors) { Client c2(cluster[2], "c2"); { - // ScopedSuppressLogging allQuiet; + ScopedSuppressLogging allQuiet; queueAndSub(c0); c0.session.messageTransfer(content=Message("x", "c0")); BOOST_CHECK_EQUAL(c0.lq.get(TIMEOUT).getData(), "x"); @@ -147,7 +147,7 @@ QPID_AUTO_TEST_CASE(testErrorAfterJoin) { ClusterFixture cluster(1, updateArgs, -1); Client c0(cluster[0]); { - // ScopedSuppressLogging allQuiet; + ScopedSuppressLogging allQuiet; c0.session.queueDeclare("q", durable=true); c0.session.messageTransfer(content=pMessage("a", "q")); |