1

running我有一个 Step Function 在运行两次后陷入状态。前 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
    }
  }
}

执行步骤

4

1 回答 1

1

更改"BackoffRate": 30"BackoffRate": 30.0. 似乎最后省略.0小数会告诉 Step Function 等待 30 分钟,而不是文档建议的 30 秒。

于 2018-03-15T00:01:00.863 回答