Add support for provisioned and reserved concurrency #7881
Add support for provisioned and reserved concurrency #7881dominikschubert merged 17 commits intomasterfrom
Conversation
dfangl
left a comment
There was a problem hiding this comment.
LGTM in general, just some things still unclear / missing TODO implementations.
28c7cc4 to
4877abc
Compare
dfangl
left a comment
There was a problem hiding this comment.
LGTM, big changes and challenging feature :)
One test is still red, but no need to re-review once this is fixed (I think).
| if ( | ||
| self.lambda_service.get_available_fn_concurrency( | ||
| self.function.latest().id.unqualified_arn() | ||
| ) | ||
| > 0 | ||
| ): |
There was a problem hiding this comment.
If we reduce the reserved concurrency and enough environments are already active, more than the "reserved" values can be run at the same time.
Nothing to hold back the merge, but we need to tackle it at some point.
There was a problem hiding this comment.
Yeah a lot of these edge cases should be tackled in a small cleanup project soon where we refactor the invocation loop & environment assignment.
Feel free to add tests for any edge cases you can think of for these cases. It'll definitely make this a lot easier for us afterwards to design the proper abstractions.We can collect these tests in a separate test class and skip it altogether for now. (not in the scope of the PR though)
joe4dev
left a comment
There was a problem hiding this comment.
Good first iteration to support the lambda concurrency features 👍
✅ The 4 tests tests.integration.awslambda.test_lambda.TestLambdaConcurrency pass on macOS
Follow-up PRs will need to cover several edge cases. Ideally, we would introduce appropriate abstractions to tackle the rising complexity of the version manager.
Account limit config addresses #7074
Background
AWS Lambda concurrency main docs page: https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html

Assumptions
Concurrent executions)Implementation
get_available_fn_concurrencybefore allowing or denying every potential invocationOpen (will mostly come in later PRs
TooManyRequestsException. We generally want to favor provisioned execution environments over on-demand.get_available_fn_concurrencyfor async invokes 🤔