首页 > 解决方案 > AWS SWF 自动取消子工作流程

问题描述

我有 AWS SWF 工作流程,它根据输入文件的数量在运行时创建许多子工作流程。对于 x 个输入文件,它将创建 x 个子工作流。当输入文件的数量在 400 个左右并成功创建和执行 400 个子工作流时,它可以正常工作。

The issue is - when my input has around 500 files or more, it starts that many child workflows successfully but then automatically cancels some of them. I have tried different configurations but nothing worked.

I think AWS limit for number of child workflows is 1000, so that should not be issue.

Current child workflow config: Execution Start To Close Timeout: 2 hours 1 minute Task Start To Close Timeout: 1 minute 30 seconds

Main workflow config: Execution Start To Close Timeout: 9 hours Task Start To Close Timeout: 1 minute 30 seconds

标签: amazon-web-servicesamazon-swf

解决方案


我的猜测是工作流代码中引发了一些异常,默认情况下会取消相同取消范围内的工作流。阅读TryCatchFinally文档以获取有关取消语义的更多信息。

一般来说,我不会推荐 SWF 中的许多子工作流,您始终可以分层执行。像 30 个孩子一样,他们每个人 30 个孩子提供 900 个工作流程。


推荐阅读