From 01b54353a0cabb7715a36fcbe703b41099e1aa17 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 28 Nov 2007 14:46:24 +0100 Subject: Changed IceGrid node to consider a server active only once its process proxy is registered --- cpp/src/IceGrid/ServerI.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'cpp/src/IceGrid/ServerI.cpp') diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 507867753d8..f6806884fb5 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -833,18 +833,31 @@ void ServerI::setProcess_async(const AMD_Server_setProcessPtr& amdCB, const Ice::ProcessPrx& process, const Ice::Current&) { bool deact = false; + ServerCommandPtr command; { Lock sync(*this); checkDestroyed(); _process = process; - deact = _state == DeactivatingWaitForProcess; - notifyAll(); + if(_state == DeactivatingWaitForProcess) + { + deact = true; + } + else + { + checkActivation(); + command = nextCommand(); + } } amdCB->ice_response(); + if(deact) { deactivate(); } + else if(command) + { + command->execute(); + } } Ice::Long @@ -2282,7 +2295,12 @@ ServerI::checkActivation() //assert(locked()); if(_state == ServerI::WaitForActivation || _state == ServerI::ActivationTimeout) { - if(includes(_activatedAdapters.begin(), _activatedAdapters.end(), + // + // Mark the server as active if the server process proxy is registered (or it's not expecting + // one to be registered) and if all the server lifetime adapters have been activated. + // + if((!_desc->processRegistered || _process) && + includes(_activatedAdapters.begin(), _activatedAdapters.end(), _serverLifetimeAdapters.begin(), _serverLifetimeAdapters.end())) { setStateNoSync(ServerI::Active); -- cgit v1.2.3