conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Dynamic Subworkflow is getting stuck in IN_PROGRESS status and tasks won't get scheduled

Open nsargar opened this issue 6 years ago • 12 comments

We have workflows with following structure, W1 : T1....Tn W2 : T1(W1) -> T2 [W1 is added as subworkflow]

So in batch processing we are triggering many (issue faced at 300+ calls) workflows simultaneously in 2-3 sec duration We have found some (20-30) workflows (W1) stuck in RUNNING state After 3600+ secs task T1 of W2 gets TIMED_OUT and thus W2 gets TIMED_OUT, but workflow W1 is still in IN_PROGRESS

I did check the tasks of subworkflow W1 and some tasks are stuck in SCHEDULED state and some are completed but next task is not getting scheduled

So, What could be the issue? And will it help to add retry and timeout configuration for Task T1 of W2 workflow? say it should complete in 5 mins and if not retry 3 times So this way we can say even if it's not getting scheduled, we will force the task to be retried

got multiple logs at server [WARN ] 2020-11-09 12:22:04,197 RedisDynoQueue - Cannot get the message payload 0160d380-a73a-4eeb-b022-0d058638f8fd

and also, 2020-11-09 17:07:44,066 RedisDynoQueue - cannot add 5aa38f20-60c6-4f34-9e6a-0e6a84169e55 to the unack shard conductor_queues.test.UNACK._deciderQueue.a stream:stdout

Where 0160d380-a73a-4eeb-b022-0d058638f8fd AND 5aa38f20-60c6-4f34-9e6a-0e6a84169e55 are the task T1 id of W2

nsargar avatar Nov 10 '20 07:11 nsargar

@nsargar Is it similar to issue: https://github.com/Netflix/conductor/issues/1955

AnnsPhilip avatar Nov 10 '20 07:11 AnnsPhilip

Issue is with Tasks are not being picked for execution or not being updated.

@AnnsPhilip In your case subworkflow completes and parent workflow stucks, in my case it's opposite. Please confirm

nsargar avatar Nov 10 '20 08:11 nsargar

@nsargar Are you using worker? what is the thread count while registering task?

AnnsPhilip avatar Nov 10 '20 10:11 AnnsPhilip

got the logs at server [WARN ] 2020-11-09 12:22:04,197 RedisDynoQueue - Cannot get the message payload 0160d380-a73a-4eeb-b022-0d058638f8fd

and also, 2020-11-09 17:07:44,066 RedisDynoQueue - cannot add 5aa38f20-60c6-4f34-9e6a-0e6a84169e55 to the unack shard conductor_queues.test.UNACK._deciderQueue.a stream:stdout

Where 0160d380-a73a-4eeb-b022-0d058638f8fd AND 5aa38f20-60c6-4f34-9e6a-0e6a84169e55 are the task T1 id of W2

nsargar avatar Nov 10 '20 10:11 nsargar

@nsargar Are you using worker? what is the thread count while registering task?

Yes 100 thread count, for 24 workers

nsargar avatar Nov 10 '20 10:11 nsargar

If TPS is more try increasing the threadCount. Also you can add retryCount and retryDelay while registering worker.

AnnsPhilip avatar Nov 10 '20 10:11 AnnsPhilip

@kishorebanala Can you please check the description

nsargar avatar Nov 11 '20 10:11 nsargar

@nsargar Having retries and timeouts on subworflow task helps, but do note that it will create a new workflow on each retry. I'd also check why the task in subworkflow is being stuck in scheduled state for a long time before doing that. It it highly likely the task message is stuck in inconsistent state in the queue, and avoiding those in queuing service would also avoid tasks being stuck in scheduled state.

kishorebanala avatar Nov 17 '20 00:11 kishorebanala

Thanks @kishorebanala , any pointers where I can check task in subworkflow stuck in inconsistent state, any particular log or part of code you can point out so I can check the logs around it? I am not that much familiar with Conductor codebase, but your pointer may help me start with. Thanks again

nilesh-sargar-tavisca avatar Nov 18 '20 08:11 nilesh-sargar-tavisca

@nilesh-sargar-tavisca This would be a good start: https://netflix.github.io/conductor/faq/#my-workflow-is-running-and-the-task-is-scheduled-but-it-is-not-being-processed.

You could also check the task message in relevant queue directly to see the status of the message, and if there's any polling activity.

kishorebanala avatar Dec 01 '20 00:12 kishorebanala

This issue is stale, because it has been open for 45 days with no activity. Remove the stale label or comment, or this will be closed in 7 days.

github-actions[bot] avatar Apr 07 '21 02:04 github-actions[bot]

This issue was closed, because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Apr 15 '21 00:04 github-actions[bot]