Skip to content

Commit

Permalink
Merge pull request hpcc-systems#19136 from jakesmith/HPCC-32698-exitE…
Browse files Browse the repository at this point in the history
…xception

HPCC-32698 Fix follow on crash due to -ve leak handling exit exception

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday authored Sep 23, 2024
2 parents 5ac49e1 + cccb660 commit 7513f82
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions thorlcr/master/thgraphmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ bool CJobManager::fireException(IException *e)

bool CJobManager::execute(IConstWorkUnit *workunit, const char *wuid, const char *graphName, const SocketEndpoint &agentep)
{
Owned<IException> exception;
try
{
if (!workunit) // check workunit is available and ready to run.
Expand Down Expand Up @@ -592,12 +593,13 @@ bool CJobManager::execute(IConstWorkUnit *workunit, const char *wuid, const char
IThorException *te = QUERYINTERFACE(e, IThorException);
if (te && tea_shutdown==te->queryAction())
stopped = true;
reply(workunit, wuid, e, agentep, false);
exception.setown(e);
}
catch (CATCHALL)
{
reply(workunit, wuid, MakeStringException(0, "Unknown exception"), agentep, false);
exception.setown(makeStringException(0, "Unknown exception"));
}
reply(workunit, wuid, exception, agentep, false);
return false;
}

Expand Down Expand Up @@ -856,6 +858,7 @@ void CJobManager::run()
}
Owned<IWorkUnitFactory> factory;
Owned<IConstWorkUnit> workunit;
Owned<IException> exception;
bool allDone = false;
try
{
Expand All @@ -882,12 +885,13 @@ void CJobManager::run()
IThorException *te = QUERYINTERFACE(e, IThorException);
if (te && tea_shutdown==te->queryAction())
stopped = true;
reply(workunit, wuid, e, agentep, false);
exception.setown(e);
}
catch (CATCHALL)
{
reply(workunit, wuid, MakeStringException(0, "Unknown exception"), agentep, false);
exception.setown(makeStringException(0, "Unknown exception"));
}
reply(workunit, wuid, exception, agentep, false);

// reset for next job
setProcessAborted(false);
Expand Down Expand Up @@ -963,7 +967,7 @@ void CJobManager::reply(IConstWorkUnit *workunit, const char *wuid, IException *
{
if (!exitException)
{
exitException.setown(e);
exitException.set(e);
relayWuidException(workunit, e);
}
return;
Expand Down

0 comments on commit 7513f82

Please sign in to comment.