diff options
| author | Alan Conway <aconway@apache.org> | 2008-02-07 21:31:21 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-02-07 21:31:21 +0000 |
| commit | d3c6a8ea932954206edbcad48d19e6d21a0e4420 (patch) | |
| tree | 07c968fb200f5cad3ced42a067a532f10129229a /qpid/cpp/src/qpidd.cpp | |
| parent | a2fc3dcc8630eccb827699ba76c5ed66a1b018f9 (diff) | |
| download | qpid-python-d3c6a8ea932954206edbcad48d19e6d21a0e4420.tar.gz | |
Clean shutdown of broker: Moved signal unsafe code from Broker::shutdown
to ~Broker, moved shutdown logging from shutdown handler to main() in qpidd.cpp
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@619646 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpidd.cpp')
| -rw-r--r-- | qpid/cpp/src/qpidd.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp index 2a5862a4b9..6c20ebc58f 100644 --- a/qpid/cpp/src/qpidd.cpp +++ b/qpid/cpp/src/qpidd.cpp @@ -121,20 +121,9 @@ shared_ptr<Broker> brokerPtr; auto_ptr<QpiddOptions> options; void shutdownHandler(int /*signal*/){ - // FIXME aconway 2008-02-07: - // https://bugzilla.redhat.com/show_bug.cgi?id=431928 - - // The following commented code is in no - // way async-signal safe and is causing sporadic hangs on - // shutdown. This handler should push a shutdown event into the - // epoll poller (making sure to use only async-safe functions!) - // and let a poller thread actually do the shutdown. - - // QPID_LOG(notice, "Shutting down on signal " << signal); - // brokerPtr->shutdown(); - - // For now we just die on the signal, no cleanup. - exit(0); + // Note: do not call any async-signal unsafe functions here. + // Do any extra shtudown actions in main() after broker->run() + brokerPtr->shutdown(); } struct QpiddDaemon : public Daemon { @@ -257,7 +246,8 @@ int main(int argc, char* argv[]) brokerPtr.reset(new Broker(options->broker)); if (options->broker.port == 0) cout << uint16_t(brokerPtr->getPort()) << endl; - brokerPtr->run(); + brokerPtr->run(); + QPID_LOG(notice, "Shutting down."); } return 0; } |
