步骤功能在2次尝试后停留在“运行”状态

时间:2018-03-05 02:20:19

标签: amazon-web-services aws-step-functions

我有一个Step Function,在它运行两次后卡在running状态。前2次按预期运行。

该函数检查快照的状态并更新DynamoDB表中的记录。如果快照仍处于creating状态,则会引发异常。

{ "error": "SnapshotToolException", "cause": "{\"errorMessage\": \"There are still 1 snapshots in creating state.\", \"errorType\": \"SnapshotToolException\", \"stackTrace\": [[\"/var/task/lambda_function.py\", 5, \"lambda_handler\", \"checkSnapshotRecordsState()\"], [\"/var/task/dynamodb_control_utils.py\", 92, \"checkSnapshotRecordsState\", \"raise SnapshotToolException(log_message)\"]]}" }

{
  "Comment": "Triggers check DynamoDB snapshots records lambda function",
  "StartAt": "CheckSnapshots",
  "States": {
    "CheckSnapshots": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:us-east-1:ACCOUNT:function:checkDynamoDBSnapshotRecords",
      "Retry": [
        {
          "ErrorEquals": ["SnapshotToolException"],
          "IntervalSeconds": 120,
          "MaxAttempts": 20,
          "BackoffRate": 30
        }
      ],
      "End": true
    }
  }
}

Execution Steps

1 个答案:

答案 0 :(得分:0)

"BackoffRate": 30更改为"BackoffRate": 30.0。似乎在末尾省略.0小数表示步骤函数等待30分钟而不是文档建议的30秒。