diff options
author | Gordon Sim <gsim@apache.org> | 2009-03-04 11:48:25 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-03-04 11:48:25 +0000 |
commit | 24ab249c5a2b31ed0c34d3116c368093162a3a18 (patch) | |
tree | 521f944a7698e59be8504cf839ee4982d64d5809 /cpp/src | |
parent | 760fb569163116748b5104d5f803c504cd7c1af4 (diff) | |
download | qpid-python-24ab249c5a2b31ed0c34d3116c368093162a3a18.tar.gz |
Added some extra debug information on failover time.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@749969 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/FailoverManager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/FailoverManager.cpp b/cpp/src/qpid/client/FailoverManager.cpp index ab9dbca70f..86b50a0a61 100644 --- a/cpp/src/qpid/client/FailoverManager.cpp +++ b/cpp/src/qpid/client/FailoverManager.cpp @@ -21,12 +21,15 @@ #include "FailoverManager.h" #include "qpid/Exception.h" #include "qpid/log/Statement.h" +#include "qpid/sys/Time.h" namespace qpid { namespace client { using qpid::sys::Monitor; +using qpid::sys::AbsTime; +using qpid::sys::Duration; FailoverManager::FailoverManager(const ConnectionSettings& s, ReconnectionStrategy* rs) : settings(s), strategy(rs), state(IDLE) {} @@ -35,15 +38,21 @@ void FailoverManager::execute(Command& c) { bool retry = false; bool completed = false; + AbsTime failed; while (!completed) { try { AsyncSession session = connect().newSession(); + if (retry) { + Duration failoverTime(failed, AbsTime::now()); + QPID_LOG(info, "Failed over for " << &c << " in " << (failoverTime/qpid::sys::TIME_MSEC) << " milliseconds"); + } c.execute(session, retry); session.sync();//TODO: shouldn't be required session.close(); completed = true; } catch(const TransportFailure&) { - retry = true; + retry = true; + failed = AbsTime::now(); } } } |