gpt4 book ai didi

amazon-web-services - MaxConcurrency 属性如何用于 AWS Step Functions 中的 Map 任务?

转载 作者:行者123 更新时间:2023-12-01 01:48:50 25 4
gpt4 key购买 nike

更新:从 Map State 步骤模板创建一个步骤函数并运行它也会引发错误。这有力地证明了 MaxConcurrency属性与 Parameters值(value)不起作用。

我无法使用 MaxConcurrency属性在阶跃函数定义中成功。

这可以通过使用 documentation 中提供的示例来证明。对于 map task (自 2019 年 9 月 18 日起新​​增):

{
"StartAt": "ExampleMapState",
"States": {
"ExampleMapState": {
"Type": "Map",
"MaxConcurrency": 2,
"Parameters": {
"ContextIndex.$": "$$.Map.Item.Index",
"ContextValue.$": "$$.Map.Item.Value"
},
"Iterator": {
"StartAt": "TestPass",
"States": {
"TestPass": {
"Type": "Pass",
"End": true
}
}
},
"End": true
}
}
}

通过使用以下输入执行 step 函数:
[
{
"who": "bob"
},
{
"who": "meg"
},
{
"who": "joe"
}
]


我们可以在 中观察执行事件历史我们得到:
  • ExecutionStarted
  • MapStateEntered
  • MapStateStarted
  • MapIterationStarted (索引 0)
  • MapIterationStarted (索引 1)
  • PassStateEntered (索引 0)
  • PassStateExited (索引 0)
  • MapIterationSucceeded (索引 0)
  • ExecutionFailed

  • 阶跃函数失败。 ExecutionFailed step 具有以下输出(省略执行 id):
    {
    "error": "States.Runtime",
    "cause": "Internal Error (omitted)"
    }

    尝试使用 Catch 步骤捕获错误无效。

    我在这里做错了什么?这是一个错误吗?

    最佳答案

    对今天早上提交给 AWS 的私有(private)票据的回应;

    Thank you for contacting AWS Premium Support. My name is Akanksha and I will be assisting you with this case.

    I understand that you have been working with the new Map state feature of step functions and have noticed that when we use Parameters along with MaxConcurrency set to lower value than the number of iterations (with only first iteration successful) it fails with ‘States.Runtime’ and looks like a bug with the functionality.

    Thank you for providing the details. It helped me during troubleshooting. In order to confirm the behavior, I used the below state machine example with Pass:

    { "StartAt": "Map State", "TimeoutSeconds": 3600, "States": { "Map State": { "Type": "Map”, "Parameters": { “ContextValue.$”: "$$.Map.Item.Value" }, "MaxConcurrency": 1, "Iterator": { "StartAt": "Run Task", "States": { "Run Task": { "Type": "Pass", "End": true } } }, "Next": "Final State" }, "Final State": { "Type": "Pass", "End": true } } }

    I tested with multiple input lists and MaxConcurrency values and below are my observations:

    1. Input size list: 4 MaxConcurrency:1/2/3 - Fails and MaxConcurrency:0/4/5 or above - Works
    2. Input size list: 3 MaxConcurrency: 1/2 - Fails and MaxConcurrency:0/3/4 or above - Works
    3. Similarly, I performed tests by removing the parameters from state machine as well and could see that it works as expected with different MaxConcurrency values.
    4. I also tested the same by changing the Task type of “Pass” with “Lambda” and observed the same behavior.

    Hence, I can confirm that the state machine fails when we have parameters in the code and specify MaxConcurrency value as anything other than zero or the number greater than or equal to the list size.

    After doing some research regarding this behavior to check if this is intended, I could not find much information regarding the same as this is a new feature. So, I will be reaching out to the internal team with all the details and the example state machine that you have provided. Thank you for bringing this to our notice. I will get back to you as soon as I have an update from the internal team. Please be assured that I will regularly follow up with the team and work with them to investigate further.

    Meanwhile, if you have any other queries or concerns, please do let me know.

    Have a great day ahead!



    当我得到更多信息时,我会在这里更新。

    关于amazon-web-services - MaxConcurrency 属性如何用于 AWS Step Functions 中的 Map 任务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58083766/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com