From 727c8ad69f7f3b7d45654c1cd4feaac094b7ab86 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Fri, 19 Jun 2020 16:46:25 +0200 Subject: [PATCH] Work on tests randomly failing. --- src/runtime/PythonNode.cxx | 2 +- src/runtime/SalomeContainerTools.cxx | 48 ++++++++++++++++------------ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/runtime/PythonNode.cxx b/src/runtime/PythonNode.cxx index 579d49b8b..a7b850dbb 100644 --- a/src/runtime/PythonNode.cxx +++ b/src/runtime/PythonNode.cxx @@ -402,7 +402,7 @@ void PythonNode::executeRemote() { DEBTRACE( "++++++++++++++ PyNode::executeRemote: " << getName() << " ++++++++++++++++++++" ); if(!_pyfuncSer) - throw Exception("DistributedPythonNode badly loaded"); + throw Exception("PythonNode badly loaded"); // if(dynamic_cast(getContainer())) { diff --git a/src/runtime/SalomeContainerTools.cxx b/src/runtime/SalomeContainerTools.cxx index 7cbaacce6..6cc052191 100644 --- a/src/runtime/SalomeContainerTools.cxx +++ b/src/runtime/SalomeContainerTools.cxx @@ -396,27 +396,33 @@ void SalomeContainerToolsBase::Start(const std::vector& compoNames, } } - if(CORBA::is_nil(trueCont)) - try - { - // --- GiveContainer is used in batch mode to retreive launched containers, - // and is equivalent to StartContainer when not in batch. - trueCont=contManager->GiveContainer(myparams); - } - catch( const SALOME::SALOME_Exception& ex ) - { - std::string msg="SalomeContainer::start : Unable to launch container in Salome : "; - msg += '\n'; - msg += ex.details.text.in(); - throw Exception(msg); - } - catch(CORBA::COMM_FAILURE&) - { - throw Exception("SalomeContainer::start : Unable to launch container in Salome : CORBA Comm failure detected"); - } - catch(CORBA::Exception&) + int nbTries=0; + while(CORBA::is_nil(trueCont)) { - throw Exception("SalomeContainer::start : Unable to launch container in Salome : Unexpected CORBA failure detected"); + try + { + // --- GiveContainer is used in batch mode to retreive launched containers, + // and is equivalent to StartContainer when not in batch. + trueCont=contManager->GiveContainer(myparams); + } + catch( const SALOME::SALOME_Exception& ex ) + { + std::string msg="SalomeContainer::start : Unable to launch container in Salome : "; + msg += '\n'; + msg += ex.details.text.in(); + throw Exception(msg); + } + catch(CORBA::COMM_FAILURE&) + { + std::cerr << "SalomeContainer::start : CORBA Comm failure detected. Make another try!" << std::endl; + nbTries++; + if(nbTries > 5) + throw Exception("SalomeContainer::start : Unable to launch container in Salome : CORBA Comm failure detected"); + } + catch(CORBA::Exception&) + { + throw Exception("SalomeContainer::start : Unable to launch container in Salome : Unexpected CORBA failure detected"); + } } if(CORBA::is_nil(trueCont)) @@ -546,4 +552,4 @@ Engines::ContainerParameters SalomeContainerToolsDecorator::getParameters() cons std::string zeMachine(_pg->deduceMachineFrom(iPos,nbProcPerNode)); ret.resource_params.hostname=CORBA::string_dup(zeMachine.c_str()); return ret; -} \ No newline at end of file +} -- 2.39.2