From b5042ce24aaa2dcff2092046b322ff61c3d9ef8c Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 7 Jan 2009 19:37:17 +0100 Subject: Squashed commit of the following: commit 8019e6de4480f361a83d8944afec60793454c322 Author: Benoit Foucher Date: Wed Jan 7 17:16:40 2009 +0100 Fixed bug 3516 - Fixed scaling issue when using round-robin replica groups commit 6c36afb32dda8b37b7d5330ed51a439bc73b17db Author: Benoit Foucher Date: Wed Jan 7 17:16:36 2009 +0100 Fixed bug 3230 - IceGrid node leak --- cpp/src/IceGrid/AdapterCache.cpp | 47 ++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'cpp/src/IceGrid/AdapterCache.cpp') diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index f6970f4e09e..af24d9da061 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -231,7 +231,7 @@ ServerAdapterEntry::ServerAdapterEntry(AdapterCache& cache, void ServerAdapterEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& nReplicas, bool& replicaGroup, - bool& roundRobin) + bool& roundRobin, const set&) { nReplicas = 1; replicaGroup = false; @@ -242,11 +242,6 @@ ServerAdapterEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& adapters.push_back(info); } -void -ServerAdapterEntry::increaseRoundRobinCount(int roundRobinCount) -{ -} - float ServerAdapterEntry::getLeastLoadedNodeLoad(LoadSample loadSample) const { @@ -383,7 +378,7 @@ ReplicaGroupEntry::update(const LoadBalancingPolicyPtr& policy) void ReplicaGroupEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& nReplicas, bool& replicaGroup, - bool& roundRobin) + bool& roundRobin, const set& excludes) { vector replicas; bool adaptive = false; @@ -453,32 +448,28 @@ ReplicaGroupEntry::getLocatorAdapterInfo(LocatorAdapterInfoSeq& adapters, int& n // for(vector::const_iterator p = replicas.begin(); p != replicas.end(); ++p) { - try - { - int dummy; - bool dummy2; - bool dummy3; - (*p)->getLocatorAdapterInfo(adapters, dummy, dummy2, dummy3); - } - catch(const AdapterNotExistException&) - { - } - catch(const NodeUnreachableException&) - { - } - catch(const DeploymentException&) + if(!roundRobin || excludes.find((*p)->getId()) == excludes.end()) { + try + { + int dummy; + bool dummy2; + bool dummy3; + (*p)->getLocatorAdapterInfo(adapters, dummy, dummy2, dummy3, set()); + } + catch(const AdapterNotExistException&) + { + } + catch(const NodeUnreachableException&) + { + } + catch(const DeploymentException&) + { + } } } } -void -ReplicaGroupEntry::increaseRoundRobinCount(int count) -{ - Lock sync(*this); - _lastReplica = (_lastReplica + count) % static_cast(_replicas.size()); -} - float ReplicaGroupEntry::getLeastLoadedNodeLoad(LoadSample loadSample) const { -- cgit v1.2.3