summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-01-09 04:50:35 +0000
committerAlan Conway <aconway@apache.org>2009-01-09 04:50:35 +0000
commit11e35dd461a19e23053756cee5c4ec214fa5597f (patch)
tree8095750bea88b52ba9333cf0f35b3fc5e3ebaccf /cpp/src/qpid/cluster/Cluster.cpp
parent92cbb60068d48c36108cb9e3ec436d2808428d15 (diff)
downloadqpid-python-11e35dd461a19e23053756cee5c4ec214fa5597f.tar.gz
Added --cluster-read-max: max number of outstanding mcasts in CPG buffers.
Work around problems with CPG flow control. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@732925 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index ef6285481c..52f5e4872d 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -83,7 +83,7 @@ struct ClusterDispatcher : public framing::AMQP_AllOperations::ClusterHandler {
bool invoke(AMQBody& body) { return framing::invoke(*this, body).wasHandled(); }
};
-Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b, bool quorum_, size_t readMax_, size_t writeEstimate_) :
+Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b, bool quorum_, size_t readMax_, size_t writeEstimate_, size_t mcastMax) :
broker(b),
poller(b.getPoller()),
cpg(*this),
@@ -98,7 +98,7 @@ Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b, b
0, // write
boost::bind(&Cluster::disconnect, this, _1) // disconnect
),
- mcast(cpg, poller, boost::bind(&Cluster::leave, this)),
+ mcast(cpg, mcastMax, poller, boost::bind(&Cluster::leave, this)),
mgmtObject(0),
deliverQueue(boost::bind(&Cluster::delivered, this, _1), poller),
state(INIT),
@@ -193,7 +193,9 @@ void Cluster::deliver(
void Cluster::deliver(const Event& e, Lock&) {
if (state == LEFT) return;
QPID_LOG(trace, *this << " PUSH: " << e);
- deliverQueue.push(e); // Otherwise enqueue for processing.
+ if (e.getMemberId() == myId)
+ mcast.delivered(e); // Note delivery for flow control
+ deliverQueue.push(e);
}
// Entry point: called when deliverQueue has events to process.