fix(core): Prevent false stalled jobs in queue mode from displaying as errored (#7435)
This is related to an issue with how Bull handles stalled jobs, see https://github.com/OptimalBits/bull/issues/1415 for reference. CPU intensive workflows can in certain cases take a long while to finish up, thereby blocking the thread and causing Bull queue to think the job has stalled, even though it finished successfully. In these cases the error handling could then overwrite the successful execution data with the error message.
This commit is contained in:
committed by
GitHub
parent
c599006b91
commit
e01b9e5ae1
@@ -86,6 +86,24 @@ export class WorkflowRunner {
|
||||
) {
|
||||
ErrorReporter.error(error);
|
||||
|
||||
const isQueueMode = config.getEnv('executions.mode') === 'queue';
|
||||
|
||||
// in queue mode, first do a sanity run for the edge case that the execution was not marked as stalled
|
||||
// by Bull even though it executed successfully, see https://github.com/OptimalBits/bull/issues/1415
|
||||
|
||||
if (isQueueMode && executionMode !== 'manual') {
|
||||
const executionWithoutData = await Container.get(ExecutionRepository).findSingleExecution(
|
||||
executionId,
|
||||
{
|
||||
includeData: false,
|
||||
},
|
||||
);
|
||||
if (executionWithoutData?.finished === true && executionWithoutData?.status === 'success') {
|
||||
// false positive, execution was successful
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const fullRunData: IRun = {
|
||||
data: {
|
||||
resultData: {
|
||||
|
||||
Reference in New Issue
Block a user