英文:
forked subworkflows all to run to completion but fail the parent workflow if one or more do fail
问题
考虑在Netflix Conductor(或Orkes)中的一个情况,其中有两个子工作流以并行方式分叉。FORK + SUB_WORKFLOW + JOIN 任务的默认行为是,如果第一个子工作流失败,第二个子工作流将在执行过程中中止并被取消。建议的解决方法是将两个SUBWORKFLOW任务都标记为可选,以确保两者都运行到完成。然而,这样做的后果是父工作流现在总是以“COMPLETED_WITH_ERRORS”显示失败的SUB_WORKFLOW而已。
是否有一种简单的方法让两个子工作流都运行到完成,但如果一个或多个子工作流失败,则使父工作流失败?感觉这应该是JOIN任务的责任,但是该任务实际上并不可配置。
英文:
consider a case in netflix conductor (or orkes) where 2 subworkflows are forked in paralel. The default behaviour of FORK + SUB_WORKFLOW + JOIN tasks is that if the first subworkflow fails, the second one is aborted midway through execution and CANCELLED. The workaround suggested to run both to completion is to mark both SUBWORKFLOW tasks as optional. However the consequence here is that the parent workflow now ends up always COMPLETED only showing the failed SUB_WORKFLOW as "COMPLETED_WITH_ERRORS".
Is there a simple way to have both subworkflows run to completion but have the parent fail if one or more of the subworkflows fail? It feels like that should be the responsibility of the JOIN task but that one is really not configurable.
答案1
得分: 3
你可以尝试使用脚本来完成连接。这是最近添加的功能,尚未推送到上游的开源项目,但你可以在play.orkes.io上尝试它。
文档链接:
https://orkes.io/content/reference-docs/operators/join
(查看使用连接脚本的最后一个示例)
英文:
You could try using a script to complete the join. This was added recently as a feature - yet to be pushed to upstream OSS but you can try it out at play.orkes.io.
documentation:
https://orkes.io/content/reference-docs/operators/join
(See the last example of using join script)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论