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 | 509b897912db272a858d5a3e2c551ee934948f9d (patch) | |
| tree | a15e5a13c4cfd4578ce78b902743c0d9c34e6807 /qpid/cpp/src | |
| parent | 273ba63c838834b46cf4c23c1ead8ccc27d8f19b (diff) | |
| download | qpid-python-509b897912db272a858d5a3e2c551ee934948f9d.tar.gz | |
Added some extra debug information on failover time.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@749969 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/client/FailoverManager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/client/FailoverManager.cpp b/qpid/cpp/src/qpid/client/FailoverManager.cpp index ab9dbca70f..86b50a0a61 100644 --- a/qpid/cpp/src/qpid/client/FailoverManager.cpp +++ b/qpid/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(); } } } |
