aws-samples/aws-health-aware

Throttling exception when calling "describe_affected_entities_for_organization"

ajmsra opened this issue · 3 comments

@jordanaroth @gmridula Lambda function is throwing a throttling exception, I think the issue is at L829,
health_client = get_sts_token('health')

we could use
config = Config(
retries = {
'max_attempts': 10,
'mode': 'standard'
}
)
but this is not supported with get_sts_token

{
  "errorMessage": "An error occurred (ThrottlingException) when calling the DescribeAffectedAccountsForOrganization operation: Rate exceeded",
  "errorType": "ClientError",
  "stackTrace": [
    "  File \"/var/task/handler.py\", line 849, in main\n    describe_org_events(health_client)\n",
    "  File \"/var/task/handler.py\", line 742, in describe_org_events\n    affected_org_accounts = get_health_org_accounts(health_client, event, event_arn)\n",
    "  File \"/var/task/handler.py\", line 323, in get_health_org_accounts\n    for event_accounts_page in event_accounts_page_iterator:\n",
    "  File \"/var/runtime/botocore/paginate.py\", line 255, in __iter__\n    response = self._make_request(current_kwargs)\n",
    "  File \"/var/runtime/botocore/paginate.py\", line 332, in _make_request\n    return self._method(**current_kwargs)\n",
    "  File \"/var/runtime/botocore/client.py\", line 386, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n",
    "  File \"/var/runtime/botocore/client.py\", line 705, in _make_api_call\n    raise error_class(parsed_response, operation_name)\n"
  ]
}

Thanks @ajmsra we saw that a few times as well. By chance, what is your Search Back parameter set to?

@jordanaroth Search Back parameter is set to 1

@ajmsra I saw your earlier comment about a possible fix. Did you run into issues and remove the comment?