diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-17 11:28:48 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-17 11:28:48 +0200 |
commit | e85fcf92f2af54b0add679e19262a42f92fedc92 (patch) | |
tree | f65b3f5251addf661c63665ea5d7bc6a0b2e5a20 /cpp/src/IceGrid/ServerI.cpp | |
parent | Fixed (ICE-5752) - faultTolerance OS X 10.10 failures with SSL (diff) | |
download | ice-e85fcf92f2af54b0add679e19262a42f92fedc92.tar.bz2 ice-e85fcf92f2af54b0add679e19262a42f92fedc92.tar.xz ice-e85fcf92f2af54b0add679e19262a42f92fedc92.zip |
Fixed ICE-5518: allows saving application with no-restart when removing stopped server
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 0ea70b5fc14..d75277ebb85 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1324,6 +1324,15 @@ ServerI::checkUpdate(const InternalServerDescriptorPtr& desc, bool noRestart, co throw DeploymentException("server not loaded"); } + if(!desc) + { + if(noRestart && !StopCommand::isStopped(_state) && !_stop) + { + throw DeploymentException("the server is running"); + } + return true; + } + InternalServerDescriptorPtr d = _load ? _load->getInternalServerDescriptor() : _desc; if(!descriptorUpdated(d, desc)) { @@ -1357,8 +1366,21 @@ ServerI::checkUpdate(const InternalServerDescriptorPtr& desc, bool noRestart, co return StopCommand::isStopped(_state); } +void +ServerI::checkRemove(bool noRestart, const Ice::Current&) +{ + Lock sync(*this); + checkDestroyed(); + + if(noRestart && !StopCommand::isStopped(_state) && !_stop) + { + throw DeploymentException("the server is running"); + } +} + ServerCommandPtr -ServerI::destroy(const AMD_Node_destroyServerPtr& amdCB, const string& uuid, int revision, const string& replicaName) +ServerI::destroy(const AMD_Node_destroyServerPtr& amdCB, const string& uuid, int revision, const string& replicaName, + bool noRestart) { Lock sync(*this); checkDestroyed(); @@ -1372,8 +1394,13 @@ ServerI::destroy(const AMD_Node_destroyServerPtr& amdCB, const string& uuid, int if(!StopCommand::isStopped(_state) && !_stop) { + if(noRestart) + { + throw DeploymentException("removal requires server to be stopped"); + } _stop = new StopCommand(this, _node->getTimer(), _deactivationTimeout); } + if(!_destroy) { // |