-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support retry strategy on Lambda LogRetention #8257
Comments
This prevents throttling issues on stacks with a lot of Lambdas. fixes aws#8257
Added PR with a change that fixes the issue. Code was inspired by a similar fix in: https://github.com/aws/aws-cdk/pull/2053/files Not sure if this is the right approach though. Can imagine this can be better managed in one central location and/or be configurable. |
Re-classified this as a feature request. |
…8258) This prevents throttling issues on stacks with a lot of Lambdas. fixes #8257 Implemented configurable `maxRetries` and `base` properties as part of the LogRetentionRetryOptions. The AWS SDK also supports specifying a customBackoff function. I skipped that as it's hard to implement in the current setup (impossible to provide a callback function in the event JSON). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is my config for logRetentionRetryOptions. I'm still testing but it seems to fix the 'Rate exceeded' error. @jaapvanblaaderen thank you for developing this feature! |
Mine seems fixed too. Thanks @georstoy ! |
@jaapvanblaaderen . Thanks for implementing the retry mechanism on the logs retention. Keep up the good work mate !! |
I'm getting warning messages that Is this a different option we are supposed to set, or is this just supposed to be resolved without any additional changes? |
Are you sure? As far as I know only the |
"aws-cdk-lib.aws_logs.LogRetentionRetryOptions#base is deprecated" LOL, gotta work on that reading comprehension. Never mind. Thanks for the correction! |
Deployment of one of our CDK projects randomly fails with rate exceeded errors. These errors occur when CDK creates LogRetention resources related to the Lambda functions we have.
Reproduction Steps
The issue occurs when deploying multiple CDK stacks that contain quite some Lamba's with log retention resources.
I created a small test project to reproduce the issue: https://github.com/jaapvanblaaderen/log-retention-rate-limit With this simple setup, I wasn't able to reproduce the issue when deploying a few stacks sequentially (which is what we use in our actual project). The issue can however be observed when deploying the stacks in parallel.
Error Log
Environment
Analysis
It fails when creating CloudWatch log groups. The issue could be fixed by relaxing the retry options for the CloudWatch SDK instance, I tested this locally by changing it to:
Another solution might be increasing a service limit. Unfortunately, I have no clue which rate limit is being hit here. It's not clear from the documentation:
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: