-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add support for provisioned and reserved concurrency #7881
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general, just some things still unclear / missing TODO implementations.
28c7cc4
to
4877abc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_concurrency
before 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_concurrency
for async invokes 🤔