-
-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Orquesta workflow gets stuck in running state #5029
Comments
The provided workflow is a very simplified version of what I have here working fine with mistral but struggling to find a workaround in orquesta after conversion so far :( |
The workflow can be simplified to:
|
Ok, I dug a bit into the sources of orquesta, and found a couple of things: First: https://github.com/StackStorm/orquesta/blob/master/orquesta/machines.py#L305: events.ACTION_FAILED_TASK_DORMANT_ITEMS_INCOMPLETE: statuses.FAILED, Changed it to: events.ACTION_FAILED_TASK_DORMANT_ITEMS_INCOMPLETE: statuses.RUNNING, and also added (probably not necessary, because in my case the one above was causing this issue, but I added it just in case, to complete the herd, so to speak): events.ACTION_FAILED_TASK_ACTIVE_ITEMS_INCOMPLETE: statuses.RUNNING, That restored the logic of "process all items first, then transition to next task" based on the condition defined in Second - and this one is a bit more complicated: https://github.com/StackStorm/orquesta/blob/master/orquesta/conducting.py#L912-L915 # Remove task from staging if exists but keep entry
# if task has items and failed for manual rerun.
if not (task_spec.has_items() and new_task_status in statuses.ABENDED_STATUSES):
self.workflow_state.remove_staged_task(task_id, route) This condition doesn't remove staged task when a task with @m4dcoder could you suggest a better fix than removing the condition? |
By the way, this also fixes #4968 |
To address StackStorm/st2#5029
To address StackStorm/st2#5029
Possibly related - StackStorm/orquesta#212 |
StackStorm/st2#5029 (comment) > That restored the logic of > "process all items first, then transition to next task" > based on the condition defined in when. Originally in: igcherkaev@2baa66d
StackStorm/st2#5029 (comment) > That restored the logic of > "process all items first, then transition to next task" > based on the condition defined in when. Originally in: igcherkaev@2baa66d
SUMMARY
Orquesta workflow gets stuck in running state, and with-items works incorrectly (at least it's different from mistral and not documented that it's this way by design). In mistral, task with with-items does not transition to another task until all items are processed, regardless whether they fail or not in the middle of the loop. In orquesta, if task with the first item fails, it immediately starts the task that's defined under
failed()
condition. If all items succeed, orquesta works exactly as mistral by processing all items first, then transitioning to the next task. I think this is a bug, which in its turn leads to the workflow never reaching final state and gets stuck in running state.STACKSTORM VERSION
Paste the output of
st2 --version
:OS, environment, install method
Post what OS you are running this on, along with any other relevant information/
Steps to reproduce the problem
Meta:
Workflow:
Expected Results
Two
task_1
executed and fail, then tworun_check_1
executed and finally complete the workflow and not get stuck.Actual Results
So as can be seen here, right after
task_1
failed, orquesta engine startedrun_check_1
task without waiting for another item in the list to be processed. But in case oftask_2
it did wait for both of the items to be processed before transitioning torun_check_2
, which is what expected in both cases. And this workflow never completes.The text was updated successfully, but these errors were encountered: