qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r749969 - /qpid/trunk/qpid/cpp/src/qpid/client/FailoverManager.cpp
Date Wed, 04 Mar 2009 11:48:25 GMT
Author: gsim
Date: Wed Mar  4 11:48:25 2009
New Revision: 749969

URL: http://svn.apache.org/viewvc?rev=749969&view=rev
Log:
Added some extra debug information on failover time.


Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/FailoverManager.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/FailoverManager.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/FailoverManager.cpp?rev=749969&r1=749968&r2=749969&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/FailoverManager.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/FailoverManager.cpp Wed Mar  4 11:48:25 2009
@@ -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 @@
 {
     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();
         }            
     }
 }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message