From 11e35dd461a19e23053756cee5c4ec214fa5597f Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 9 Jan 2009 04:50:35 +0000 Subject: 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 --- cpp/src/qpid/cluster/Cluster.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/cluster/Cluster.cpp') 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. -- cgit v1.2.1