diff options
| author | Alan Conway <aconway@apache.org> | 2008-10-16 17:07:26 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-10-16 17:07:26 +0000 |
| commit | d39a165c9c8d1fa2fd728a2237117efa71848874 (patch) | |
| tree | dd07b81f1f2d2de42ce2fdf28432130566a5622e /cpp/src/qpid/client/Dispatcher.cpp | |
| parent | f7a4f7bcf77726767d0905f56f5c44c7a34d82a3 (diff) | |
| download | qpid-python-d39a165c9c8d1fa2fd728a2237117efa71848874.tar.gz | |
Fix race in cluster causing incorrect known-broker lists to be sent to clients.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705287 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Dispatcher.cpp')
| -rw-r--r-- | cpp/src/qpid/client/Dispatcher.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp index fd9d8a8ad1..32d0001040 100644 --- a/cpp/src/qpid/client/Dispatcher.cpp +++ b/cpp/src/qpid/client/Dispatcher.cpp @@ -72,7 +72,7 @@ void Dispatcher::run() boost::state_saver<bool> reset(running); // Reset to false on exit. running = true; try { - while (!queue->isClosed()) { + while (true) { Mutex::ScopedUnlock u(lock); FrameSet::shared_ptr content = queue->pop(); if (content->isA<MessageTransferBody>()) { @@ -92,12 +92,14 @@ void Dispatcher::run() } } } - session.sync(); // Make sure all our acks are received before returning. } - catch (const ClosedException& e) - { - QPID_LOG(debug, "Ignored exception in client dispatch thread: " << e.what()); - } //ignore it and return + catch (const ClosedException& e) { + QPID_LOG(debug, "Dispatch thread exiting, session closed: " << session.getId()); + try { + session.sync(); // Make sure all our acks are received before returning. + } + catch(...) {} + } catch (const std::exception& e) { QPID_LOG(error, "Exception in client dispatch thread: " << e.what()); if ( failoverHandler ) |
