Skip to content

Commit

Permalink
Fixed IceGrid port bug where exception callback wasn't called
Browse files Browse the repository at this point in the history
  • Loading branch information
bentoi authored and pepone committed Jan 9, 2024
1 parent a7eb0cc commit 2c53404
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cpp/src/IceGrid/NodeI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,8 @@ NodeI::loadServer(shared_ptr<InternalServerDescriptor> descriptor, string replic

try
{
command = server->load(descriptor, replicaName, noRestart, std::move(response), std::move(exception));
// Don't std::move response/exception as we may need to loop and call again load.
command = server->load(descriptor, replicaName, noRestart, response, exception);
}
catch(const Ice::ObjectNotExistException&)
{
Expand Down
7 changes: 6 additions & 1 deletion cpp/src/IceGrid/ServerI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,8 @@ ServerI::load(const shared_ptr<InternalServerDescriptor>& desc, const string& re
{
adapters.insert({ adapter.first, adapter.second->getProxy() });
}
response(_this, adapters, secondsToInt(_activationTimeout), secondsToInt(_deactivationTimeout)); }
response(_this, adapters, secondsToInt(_activationTimeout), secondsToInt(_deactivationTimeout));
}
else if(_state == InternalServerState::Active)
{
_load->addCallback(response, exception); // Must be called before startRuntimePropertiesUpdate!
Expand Down Expand Up @@ -1629,6 +1630,10 @@ ServerI::activate()
{
_node->getMasterNodeSession()->waitForApplicationUpdateAsync(desc->uuid, desc->revision,
[self = shared_from_this()]
{
self->waitForApplicationUpdateCompleted();
},
[self = shared_from_this()](exception_ptr)
{
self->waitForApplicationUpdateCompleted();
});
Expand Down
16 changes: 11 additions & 5 deletions scripts/IceGridUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ def setup(self, current):
def teardown(self, current, success):
Server.teardown(self, current, success)
# Remove the database directory tree
try:
shutil.rmtree(self.dbdir)
except:
pass
if success or current.driver.isInterrupted():
try:
shutil.rmtree(self.dbdir)
except:
pass

def getProps(self, current):
props = {
Expand Down Expand Up @@ -235,6 +236,11 @@ def init(self, mapping, testsuite):

def setupClientSide(self, current):
if self.application:
try:
self.runadmin(current, "application remove Test", quiet=True)
except:
pass

javaHome = os.environ.get("JAVA_HOME", None)
serverProps = Server().getProps(current)
variables = {
Expand Down Expand Up @@ -264,7 +270,7 @@ def setupClientSide(self, current):
self.runadmin(current, "application add -n {0} {1} {2}".format(application, varStr, targets))

def teardownClientSide(self, current, success):
if self.application:
if (success or current.driver.isInterrupted()) and self.application:
self.runadmin(current, "application remove Test")

for p in self.icegridnode + self.icegridregistry:
Expand Down

0 comments on commit 2c53404

Please sign in to comment.