Skip to content

Conversation

@bmoffatt
Copy link
Collaborator

@bmoffatt bmoffatt commented Dec 1, 2025

Description of changes:

This change adds support for the AWS_LAMBDA_MAX_CONCURRENCY environment variable. When present, Lambda will handle up to AWS_LAMBDA_MAX_CONCURRENCY events concurrently using a single instance of an execution environment. This environment variable is set by Lambda when a function is configured to use Managed Instances

Notes

  • lambdacontext.MaxConcurrency() returns AWS_LAMBDA_MAX_CONCURRENCY, or 1 if not present.
  • Concurrent events are only handled when compiling with go version >= v1.22.0.
  • A RuntimeAPI client and goroutine are created per unit of requested concurrency.
  • If a handler panics (or other internal aws-lambda-go error encountered), the process will still exit. However, before exiting, goroutines blocked waiting for /next will be canceled, and inflight requests will be allowed to run to completion.
  • Buffer re-use has been changed to utilize sync.Pool.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bmoffatt bmoffatt marked this pull request as ready for review December 2, 2025 01:50
@bmoffatt bmoffatt merged commit 36c1cc3 into aws:main Dec 3, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant