diff options
| author | Alan Conway <aconway@apache.org> | 2008-10-17 16:13:13 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-10-17 16:13:13 +0000 |
| commit | a039e57108ed06586e73a255dc824ed27fc6de2a (patch) | |
| tree | 22683a3561307ab6ccfa6ba1107a4e5e4c7a0b9e /cpp/src/qpid | |
| parent | 1a0e5ee95bbc32a78daeed9e6538921a9b86157d (diff) | |
| download | qpid-python-a039e57108ed06586e73a255dc824ed27fc6de2a.tar.gz | |
Suppress logging expected errors in tests.
Improved log messages for connection, session errors.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/client/Connector.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/client/Dispatcher.cpp | 19 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/BlockingQueue.h | 4 |
3 files changed, 14 insertions, 11 deletions
diff --git a/cpp/src/qpid/client/Connector.cpp b/cpp/src/qpid/client/Connector.cpp index fe7793c432..e674a738c2 100644 --- a/cpp/src/qpid/client/Connector.cpp +++ b/cpp/src/qpid/client/Connector.cpp @@ -394,7 +394,7 @@ void TCPConnector::run(){ aio->queueForDeletion(); socket.close(); } catch (const std::exception& e) { - QPID_LOG(error, e.what()); + QPID_LOG(error, QPID_MSG("FAIL " << identifier << ": " << e.what())); handleClosed(); } } diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp index 32d0001040..af805a3808 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 (true) { + while (!queue->isClosed()) { Mutex::ScopedUnlock u(lock); FrameSet::shared_ptr content = queue->pop(); if (content->isA<MessageTransferBody>()) { @@ -92,18 +92,19 @@ void Dispatcher::run() } } } + session.sync(); // Make sure all our acks are received before returning. } - 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 ClosedException&) { + QPID_LOG(debug, QPID_MSG(session.getId() << ": closed by peer")); } catch (const std::exception& e) { - QPID_LOG(error, "Exception in client dispatch thread: " << e.what()); - if ( failoverHandler ) + if ( failoverHandler ) { + QPID_LOG(debug, QPID_MSG(session.getId() << " failover: " << e.what())); failoverHandler(); + } + else { + QPID_LOG(error, session.getId() << " error: " << e.what()); + } } } diff --git a/cpp/src/qpid/sys/BlockingQueue.h b/cpp/src/qpid/sys/BlockingQueue.h index c6c6291b97..d7e6449d7a 100644 --- a/cpp/src/qpid/sys/BlockingQueue.h +++ b/cpp/src/qpid/sys/BlockingQueue.h @@ -73,7 +73,9 @@ public: return result; } - /** Push a value onto the queue */ + /** Push a value onto the queue. + * Note it is not an error to push onto a closed queue. + */ void push(const T& t) { Mutex::ScopedLock l(waitable); queue.push(t); |
