diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-11-03 09:27:47 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-11-03 09:27:47 +0000 |
commit | e68a0e117ee67b3b0e3f64e14da73802e7877814 (patch) | |
tree | 62fc9806929cc447a694a1a5d094271766b998e4 /cpp/src/IceGrid/ServerI.cpp | |
parent | Added some IceVb stuff (diff) | |
download | ice-e68a0e117ee67b3b0e3f64e14da73802e7877814.tar.bz2 ice-e68a0e117ee67b3b0e3f64e14da73802e7877814.tar.xz ice-e68a0e117ee67b3b0e3f64e14da73802e7877814.zip |
Added ordered load balancing
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 2cf219ca006..2f35755110e 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1108,7 +1108,13 @@ ServerI::adapterActivated(const string& id) ServerCommandPtr command; { Lock sync(*this); - _activeAdapters.insert(id); + if(_state != ServerI::Activating && + _state != ServerI::WaitForActivation && + _state != ServerI::ActivationTimeout) + { + return; + } + _activatedAdapters.insert(id); checkActivation(); command = nextCommand(); } @@ -1176,13 +1182,6 @@ ServerI::enableAfterFailure(bool force) } void -ServerI::adapterDeactivated(const string& id) -{ - Lock sync(*this); - _activeAdapters.erase(id); -} - -void ServerI::activationFailed(bool destroyed) { ServerCommandPtr command; @@ -1501,6 +1500,7 @@ ServerI::terminated(const string& msg, int status) // _process = 0; _pid = 0; + _activatedAdapters.clear(); bool failed = false; #ifndef _WIN32 @@ -2035,7 +2035,7 @@ ServerI::checkActivation() for(AdapterDescriptorSeq::const_iterator p = _info.descriptor->adapters.begin(); p != _info.descriptor->adapters.end(); ++p) { - if(!p->id.empty() && p->waitForActivation && _activeAdapters.find(p->id) == _activeAdapters.end()) + if(!p->id.empty() && p->waitForActivation && _activatedAdapters.find(p->id) == _activatedAdapters.end()) { return; } @@ -2049,7 +2049,9 @@ ServerI::checkActivation() ServiceDescriptorPtr desc = ServiceDescriptorPtr::dynamicCast(s->descriptor); for(AdapterDescriptorSeq::const_iterator p = desc->adapters.begin(); p != desc->adapters.end(); ++p) { - if(!p->id.empty() && p->waitForActivation && _activeAdapters.find(p->id) == _activeAdapters.end()) + if(!p->id.empty() && + p->waitForActivation && + _activatedAdapters.find(p->id) == _activatedAdapters.end()) { return; } |