diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-12-04 16:28:26 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-12-04 16:28:26 +0100 |
commit | 9f2fc6d39d6fd049538f9193005d0268adc634bf (patch) | |
tree | 8d0de92d42947bf6e9e5b47a86a9f23e53bef821 /cpp/src/IceGrid/ServerI.cpp | |
parent | ICE-5090 added openssl.cnf to installers (diff) | |
download | ice-9f2fc6d39d6fd049538f9193005d0268adc634bf.tar.bz2 ice-9f2fc6d39d6fd049538f9193005d0268adc634bf.tar.xz ice-9f2fc6d39d6fd049538f9193005d0268adc634bf.zip |
Fixed ICE-5076 - IceGrid hang when properties were updated while the server was activating
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index cc4dcf35145..49b52c3e795 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1278,15 +1278,38 @@ ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescripto _destroy = 0; } - if(amdCB) + if(_stop || StopCommand::isStopped(_state)) { - _load->addCallback(amdCB); + _load->addCallback(amdCB); // Load will return once the server is loaded. } - - if(!_stop && _state == Active) // Must be done after adding the AMD callback. + else { - updateRevision(desc->uuid, desc->revision); - _load->startRuntimePropertiesUpdate(_process); + if(_state >= ServerI::Activating && _state < ServerI::Active) + { + // + // If the server is being activated, return the response + // now. We can't wait for runtime properties to be updated + // as this could cause a deadlock if the registry needs + // the server proxy to register the server process proxy + // with the node. + // + AdapterPrxDict adapters; + for(ServerAdapterDict::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) + { + adapters.insert(make_pair(p->first, p->second->getProxy())); + } + amdCB->ice_response(_this, adapters, _activationTimeout, _deactivationTimeout); + } + else if(_state == ServerI::Active) + { + _load->addCallback(amdCB); // Must be called before startRuntimePropertiesUpdate! + updateRevision(desc->uuid, desc->revision); + _load->startRuntimePropertiesUpdate(_process); + } + else + { + _load->addCallback(amdCB); + } } return nextCommand(); } |