Author: aconway
Date: Mon Feb 13 16:19:02 2012
New Revision: 1243586

URL: http://svn.apache.org/viewvc?rev=1243586&view=rev
Log:
QPID-3603: Make link maintenance interval configurable.

HA code needs faster reconnects than federation.
This is a temporary solution till we have a more robust
and rapid reconnect mechanism in place.

Modified:
    qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.cpp
    qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.h
    qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Link.cpp
    qpid/branches/qpid-3603-2/qpid/cpp/src/tests/ha_tests.py

Modified: qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.cpp
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.cpp?rev=1243586&r1=1243585&r2=1243586&view=diff
==============================================================================
--- qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.cpp Mon Feb 13 
16:19:02 2012
@@ -127,7 +127,8 @@ Broker::Options::Options(const std::stri
     queueFlowResumeRatio(70),
     queueThresholdEventRatio(80),
     defaultMsgGroup("qpid.no-group"),
-    timestampRcvMsgs(false)     // set the 0.10 timestamp delivery property
+    timestampRcvMsgs(false),     // set the 0.10 timestamp delivery property
+    linkMaintenanceInterval(2)
 {
     int c = sys::SystemInfo::concurrency();
     workerThreads=c+1;
@@ -149,6 +150,8 @@ Broker::Options::Options(const std::stri
         ("mgmt-enable,m", optValue(enableMgmt,"yes|no"), "Enable Management")
         ("mgmt-qmf2", optValue(qmf2Support,"yes|no"), "Enable broadcast of 
management information over QMF v2")
         ("mgmt-qmf1", optValue(qmf1Support,"yes|no"), "Enable broadcast of 
management information over QMF v1")
+        // FIXME aconway 2012-02-13: consistent treatment of values in SECONDS
+        // allow sub-second intervals.
         ("mgmt-pub-interval", optValue(mgmtPubInterval, "SECONDS"), 
"Management Publish Interval")
         ("queue-purge-interval", optValue(queueCleanInterval, "SECONDS"),
          "Interval between attempts to purge any expired messages from queues")
@@ -164,7 +167,9 @@ Broker::Options::Options(const std::stri
         ("default-flow-resume-threshold", optValue(queueFlowResumeRatio, 
"PERCENT"), "Percent of queue's maximum capacity at which flow control is 
de-activated.")
         ("default-event-threshold-ratio", optValue(queueThresholdEventRatio, 
"%age of limit"), "The ratio of any specified queue limit at which an event 
will be raised")
         ("default-message-group", optValue(defaultMsgGroup, 
"GROUP-IDENTIFER"), "Group identifier to assign to messages delivered to a 
message group queue that do not contain an identifier.")
-        ("enable-timestamp", optValue(timestampRcvMsgs, "yes|no"), "Add 
current time to each received message.");
+        ("enable-timestamp", optValue(timestampRcvMsgs, "yes|no"), "Add 
current time to each received message.")
+        ("link-maintenace-interval", optValue(linkMaintenanceInterval, 
"SECONDS"))
+        ;
 }
 
 const std::string empty;

Modified: qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.h
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.h?rev=1243586&r1=1243585&r2=1243586&view=diff
==============================================================================
--- qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.h (original)
+++ qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Broker.h Mon Feb 13 
16:19:02 2012
@@ -124,6 +124,7 @@ public:
         uint16_t queueThresholdEventRatio;
         std::string defaultMsgGroup;
         bool timestampRcvMsgs;
+        double linkMaintenanceInterval; // FIXME aconway 2012-02-13: 
consistent parsing of SECONDS values.
 
       private:
         std::string getHome();

Modified: qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Link.cpp
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Link.cpp?rev=1243586&r1=1243585&r2=1243586&view=diff
==============================================================================
--- qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Link.cpp (original)
+++ qpid/branches/qpid-3603-2/qpid/cpp/src/qpid/broker/Link.cpp Mon Feb 13 
16:19:02 2012
@@ -50,10 +50,13 @@ namespace _qmf = ::qmf::org::apache::qpi
 
 struct LinkTimerTask : public sys::TimerTask {
     LinkTimerTask(Link& l, sys::Timer& t)
-        : TimerTask(/*FIXME*/100*sys::TIME_MSEC, "Link retry timer"), link(l), 
timer(t) {}
+        : 
TimerTask(int64_t(l.getBroker()->getOptions().linkMaintenanceInterval*
+                            sys::TIME_SEC),
+                    "Link retry timer"),
+          link(l), timer(t) {}
 
     void fire() {
-        link.maintenanceVisit();  // FIXME aconway 2012-01-31:
+        link.maintenanceVisit();
         setupNextFire();
         timer.add(this);
     }

Modified: qpid/branches/qpid-3603-2/qpid/cpp/src/tests/ha_tests.py
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603-2/qpid/cpp/src/tests/ha_tests.py?rev=1243586&r1=1243585&r2=1243586&view=diff
==============================================================================
--- qpid/branches/qpid-3603-2/qpid/cpp/src/tests/ha_tests.py (original)
+++ qpid/branches/qpid-3603-2/qpid/cpp/src/tests/ha_tests.py Mon Feb 13 
16:19:02 2012
@@ -31,8 +31,8 @@ class HaBroker(Broker):
     def __init__(self, test, args=[], broker_url=None, **kwargs):
         assert BrokerTest.ha_lib, "Cannot locate HA plug-in"
         args=["--load-module", BrokerTest.ha_lib,
-              "--log-enable=debug+:ha::", # FIXME aconway 2012-01-31:
-              "--log-enable=debug+:Link",
+              # FIXME aconway 2012-02-13: workaround slow link failover.
+              "--link-maintenace-interval=0.1",
               "--ha-enable=yes"]
         if broker_url: args += [ "--ha-broker-url", broker_url ]
         Broker.__init__(self, test, args, **kwargs)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to