fix(core): Fix issue where sub workflows would display as running forever after failure to start (#5905)

* fixed recovery / status for early return in main mode

* mark non-data returning executions in own mode as failed

* improve error handling
This commit is contained in:
Michael Auerswald
2023-04-06 11:36:11 +02:00
committed by GitHub
parent 2881ee9ecc
commit 3e382ef85e
3 changed files with 25 additions and 7 deletions

View File

@@ -155,9 +155,10 @@ export async function recoverExecutionDataFromEventLogMessages(
}
if (applyToDb) {
const newStatus = executionEntry.status === 'failed' ? 'failed' : 'crashed';
await Db.collections.Execution.update(executionId, {
data: stringify(executionData),
status: 'crashed',
status: newStatus,
stoppedAt: lastNodeRunTimestamp?.toJSDate(),
});
await Container.get(InternalHooks).onWorkflowPostExecute(
@@ -170,7 +171,7 @@ export async function recoverExecutionDataFromEventLogMessages(
waitTill: executionEntry.waitTill ?? undefined,
startedAt: executionEntry.startedAt,
stoppedAt: lastNodeRunTimestamp?.toJSDate(),
status: 'crashed',
status: newStatus,
},
);
const iRunData: IRun = {
@@ -180,7 +181,7 @@ export async function recoverExecutionDataFromEventLogMessages(
waitTill: executionEntry.waitTill ?? undefined,
startedAt: executionEntry.startedAt,
stoppedAt: lastNodeRunTimestamp?.toJSDate(),
status: 'crashed',
status: newStatus,
};
const workflowHooks = getWorkflowHooksMain(
{