qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1482481 - in /qpid/trunk/qpid/cpp/src/qpid/ha: Settings.h StatusCheck.cpp
Date Tue, 14 May 2013 17:44:01 GMT
Author: aconway
Date: Tue May 14 17:44:01 2013
New Revision: 1482481

URL: http://svn.apache.org/r1482481
Log:
QPID-4839: HA Sporadic failure of ha_tests.test_join_ready_cluster

Bug in StatusCheck, was setting fetch timeout to uninitialized value
which was sometimes 0, causing an immediate timeout of fetch.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/ha/Settings.h
    qpid/trunk/qpid/cpp/src/qpid/ha/StatusCheck.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/Settings.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/Settings.h?rev=1482481&r1=1482480&r2=1482481&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/Settings.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/Settings.h Tue May 14 17:44:01 2013
@@ -37,7 +37,7 @@ class Settings
 {
   public:
     Settings() : cluster(false), queueReplication(false),
-                 replicateDefault(NONE), backupTimeout(5*sys::TIME_SEC),
+                 replicateDefault(NONE), backupTimeout(10*sys::TIME_SEC),
                  flowMessages(100), flowBytes(0)
     {}
 

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/StatusCheck.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/StatusCheck.cpp?rev=1482481&r1=1482480&r2=1482481&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/StatusCheck.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/StatusCheck.cpp Tue May 14 17:44:01 2013
@@ -47,12 +47,12 @@ class StatusCheckThread : public sys::Ru
   private:
     Url url;
     StatusCheck& statusCheck;
-    sys::Duration linkHeartbeatInterval;
     BrokerInfo brokerInfo;
 };
 
 void StatusCheckThread::run() {
     QPID_LOG(debug, statusCheck.logPrefix << "Checking status of " << url);
+    Connection c;
     try {
         Variant::Map options, clientProperties;
         clientProperties = brokerInfo.asMap(); // Detect self connections.
@@ -62,7 +62,7 @@ void StatusCheckThread::run() {
 
         options["client-properties"] = clientProperties;
         options["heartbeat"] = statusCheck.linkHeartbeatInterval/sys::TIME_SEC;
-        Connection c(url.str(), options);
+        c = Connection(url.str(), options);
 
         c.open();
         Session session = c.createSession();
@@ -81,7 +81,8 @@ void StatusCheckThread::run() {
         content["_object_id"] = oid;
         encode(content, request);
         s.send(request);
-        Message response = r.fetch(messaging::Duration(linkHeartbeatInterval/TIME_MSEC));
+        messaging::Duration timeout(statusCheck.linkHeartbeatInterval/sys::TIME_MSEC);
+        Message response = r.fetch(timeout);
         session.acknowledge();
         Variant::List contentIn;
         decode(response, contentIn);
@@ -96,7 +97,11 @@ void StatusCheckThread::run() {
             QPID_LOG(debug, statusCheck.logPrefix << "Status of " << url <<
": " << status);
         }
     } catch(const exception& error) {
-        QPID_LOG(info, "Checking status of " << url <<  ": " << error.what());
+        QPID_LOG(info, statusCheck.logPrefix << "Checking status of " << url
<<  ": " << error.what());
+    }
+    try { c.close(); }
+    catch(const exception& e) {
+        QPID_LOG(warning, statusCheck.logPrefix << "Error closing status check connection
to " << url);
     }
     delete this;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message