diff --git a/thorlcr/graph/thgraphslave.cpp b/thorlcr/graph/thgraphslave.cpp index fbb68e4f947..2ffb55e596d 100644 --- a/thorlcr/graph/thgraphslave.cpp +++ b/thorlcr/graph/thgraphslave.cpp @@ -1222,6 +1222,8 @@ void CSlaveGraph::executeSubGraph(size32_t parentExtractSz, const byte *parentEx void CSlaveGraph::abort(IException *e) { + if (aborted) + return; if (!graphDone) // set pre done(), no need to abort if got that far. CGraphBase::abort(e); getDoneSem.signal(); @@ -1229,23 +1231,27 @@ void CSlaveGraph::abort(IException *e) void CSlaveGraph::done() { - GraphPrintLog("End of sub-graph"); - progressActive.store(false); - setProgressUpdated(); // NB: ensure collected after end of graph - if (!queryOwner() || isGlobal()) + if (started) { - if (aborted || !graphDone) + GraphPrintLog("End of sub-graph"); + progressActive.store(false); + setProgressUpdated(); // NB: ensure collected after end of graph + + if (initialized && (!queryOwner() || isGlobal())) { - if (!getDoneSem.wait(SHORTTIMEOUT)) // wait on master to clear up, gather info from slaves - WARNLOG("CSlaveGraph::done - timedout waiting for master to signal done()"); + if (aborted || !graphDone) + { + if (!getDoneSem.wait(SHORTTIMEOUT)) // wait on master to clear up, gather info from slaves + WARNLOG("CSlaveGraph::done - timedout waiting for master to signal done()"); + } + else + getDoneSem.wait(); + } + if (!queryOwner()) + { + if (globals->getPropBool("@watchdogProgressEnabled")) + jobS->queryProgressHandler()->stopGraph(*this, NULL); } - else - getDoneSem.wait(); - } - if (!queryOwner()) - { - if (globals->getPropBool("@watchdogProgressEnabled")) - jobS->queryProgressHandler()->stopGraph(*this, NULL); } Owned exception;