conductor icon indicating copy to clipboard operation
conductor copied to clipboard

BUG: Invalid sub-workflow execution generates inconsistency

Open nbraquart opened this issue 9 years ago • 1 comments

Hello,

Testing the sub-workflow system task, I ran into an inconsistent state with a system task staying in SCHEDULED state. This happens when a sub-workflow cannot be started, apparently for any reason (in my case, it was either because it did not exist or because it referred to a non-existing task definition).

When starting a workflow referring to a non-existing sub-workflow, I had this stack: 22890 [qtp885339784-120] ERROR com.netflix.conductor.core.execution.tasks.SubWorkflow - Cannot find the task definitions for the following tasks used in workflow: [ping_task_definition] com.netflix.conductor.core.execution.ApplicationException: Cannot find the task definitions for the following tasks used in workflow: [ping_task_definition] at com.netflix.conductor.core.execution.WorkflowExecutor.startWorkflow(WorkflowExecutor.java:114) at com.netflix.conductor.core.execution.tasks.SubWorkflow.start(SubWorkflow.java:61) at com.netflix.conductor.core.execution.WorkflowExecutor.scheduleTask(WorkflowExecutor.java:651) at com.netflix.conductor.core.execution.WorkflowExecutor.decide(WorkflowExecutor.java:525) at com.netflix.conductor.core.execution.WorkflowExecutor.startWorkflow(WorkflowExecutor.java:134) at com.netflix.conductor.core.execution.WorkflowExecutor.startWorkflow(WorkflowExecutor.java:94) at com.netflix.conductor.server.resources.WorkflowResource.startWorkflow(WorkflowResource.java:98) ...

When starting a workflow referring to an existing sub-workflow, itself referring to a non-existing task definition, I had this stack: 20950 [qtp885339784-122] ERROR com.netflix.conductor.server.resources.GenericExceptionMapper - java.lang.NullPointerException java.lang.RuntimeException: java.lang.NullPointerException at com.netflix.conductor.core.execution.DeciderService.getTasksToBeScheduled(DeciderService.java:473) at com.netflix.conductor.core.execution.DeciderService.getTasksToBeScheduled(DeciderService.java:363) at com.netflix.conductor.core.execution.DeciderService.startWorkflow(DeciderService.java:185) at com.netflix.conductor.core.execution.DeciderService.decide(DeciderService.java:87) at com.netflix.conductor.core.execution.WorkflowExecutor.decide(WorkflowExecutor.java:505) at com.netflix.conductor.core.execution.WorkflowExecutor.startWorkflow(WorkflowExecutor.java:134) at com.netflix.conductor.core.execution.WorkflowExecutor.startWorkflow(WorkflowExecutor.java:94) at com.netflix.conductor.server.resources.WorkflowResource.startWorkflow(WorkflowResource.java:98) ...

The problem is that once the workflow is started, the only solution is to terminate it. Even if the missing workflow/task definition is added afterwards (unless I am forgetting a way to trigger a system task reexecution), it does not seem to recover. Also, this behavior breaks the UI as it expects the task execution object to contain the subWorkflowId key which in such case does not exist.

If you need any extra information, don't hesitate!

Nicolas

nbraquart avatar May 18 '17 09:05 nbraquart

This behavior should be fixed now and the SUB_WORKFLOW task should be set to FAILED state if this fails. Please reopen if you encounter this issue again.

apanicker-nflx avatar Jan 22 '19 00:01 apanicker-nflx