Skip to content

Commit

Permalink
Merge pull request #18142 from jakesmith/HPCC-31017-thorworker-k8s-er…
Browse files Browse the repository at this point in the history
…ror-report

HPCC-31017 Report cause of k8s thorworker job failure

Reviewed-By: Shamser Ahmed <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Dec 19, 2023
2 parents 5de6d8e + bf7d04f commit 08fc9a9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions thorlcr/master/thmastermain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,18 +1163,23 @@ int main( int argc, const char *argv[] )
}
if (isContainerized())
{
int retCode = exception ? TEC_Exception : 0;
if (!cloudJobName.isEmpty())
{
if (exception)
{
Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
Owned<IConstWorkUnit> wu = factory->openWorkUnit(workunit);
if (wu)
{
relayWuidException(wu, exception);
retCode = 0; // if successfully reported, suppress thormanager exit failure that would trigger another exception
}
}
if (workerJobInstalled)
{
try
{
if (exception)
{
Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
Owned<IConstWorkUnit> wu = factory->openWorkUnit(workunit);
relayWuidException(wu, exception);
}
k8s::KeepJobs keepJob = k8s::translateKeepJobs(globals->queryProp("@keepJobs"));
switch (keepJob)
{
Expand Down Expand Up @@ -1209,7 +1214,7 @@ int main( int argc, const char *argv[] )
}
}
}
setExitCode(exception ? TEC_Exception : 0);
setExitCode(retCode);
}

// cleanup handler to be sure we end
Expand Down

0 comments on commit 08fc9a9

Please sign in to comment.