Skip to content
Snippets Groups Projects
Commit c8d7b8b2 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Propagate failure of event to the EventContext for more cases

see atlas/Gaudi!21

This patch fixes:
 - setting fail flag in the EventContext for a stall
 - setting fail flag in the EventContext if an Algorithm
   throws an exception
 - don't unset the fail flag in the EventContext when an
   Algorithm hasn't failed

See merge request !165
parents d79ce220 124f4fa0
No related branches found
No related tags found
1 merge request!165Propagate failure of event to the EventContext for more cases
Pipeline #
......@@ -29,27 +29,30 @@ tbb::task* AlgoExecutionTask::execute() {
SmartIF<IMessageSvc> messageSvc (m_serviceLocator);
MsgStream log(messageSvc, "AlgoExecutionTask");
StatusCode sc(StatusCode::FAILURE);
try {
RetCodeGuard rcg(appmgr, Gaudi::ReturnCode::UnhandledException);
sc = m_algorithm->sysExecute();
if (UNLIKELY(!sc.isSuccess())) {
log << MSG::WARNING << "Execution of algorithm " << m_algorithm->name() << " failed" << endmsg;
eventfailed = true;
}
eventfailed = true;
}
rcg.ignore(); // disarm the guard
} catch ( const GaudiException& Exception ) {
log << MSG::FATAL << ".executeEvent(): Exception with tag=" << Exception.tag()
<< " thrown by " << m_algorithm->name() << endmsg;
log << MSG::ERROR << Exception << endmsg;
eventfailed = true;
} catch ( const std::exception& Exception ) {
log << MSG::FATAL << ".executeEvent(): Standard std::exception thrown by "
<< m_algorithm->name() << endmsg;
log << MSG::ERROR << Exception.what() << endmsg;
eventfailed = true;
} catch(...) {
log << MSG::FATAL << ".executeEvent(): UNKNOWN Exception thrown by "
<< m_algorithm->name() << endmsg;
eventfailed = true;
}
// Commit all DataHandles
......@@ -58,7 +61,8 @@ tbb::task* AlgoExecutionTask::execute() {
// DP it is important to propagate the failure of an event.
// We need to stop execution when this happens so that execute run can
// then receive the FAILURE
m_evtCtx->setFail(eventfailed);
if (eventfailed)
m_evtCtx->setFail(eventfailed);
// Push in the scheduler queue an action to be performed
auto action_promote2Executed = std::bind(&ForwardSchedulerSvc::promoteToExecuted,
......
......@@ -510,6 +510,8 @@ StatusCode ForwardSchedulerSvc::eventFailed(EventContext* eventContext){
// Set the number of slots available to an error code
m_freeSlots.store(0);
eventContext->setFail(true);
fatal() << "*** Event " << eventContext->evt() << " on slot "
<< eventContext->slot() << " failed! ***" << endmsg;
......@@ -721,7 +723,7 @@ StatusCode ForwardSchedulerSvc::updateStates(int si, const std::string& algo_nam
} else {
StatusCode eventStalledSC = isStalled(iSlot);
if (! eventStalledSC.isSuccess())
eventFailed(thisSlot.eventContext);
eventFailed(thisSlot.eventContext).ignore();
}
} // end loop on slots
......@@ -950,7 +952,7 @@ StatusCode ForwardSchedulerSvc::promoteToExecuted(unsigned int iAlgo, int si,
// Check if the execution failed
if (eventContext->evtFail())
eventFailed(eventContext);
eventFailed(eventContext).ignore();
StatusCode sc = m_algResourcePool->releaseAlgorithm(algo->name(),algo);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment