Skip to content

Add Lambda Managed Instances (LMI) / Multi-Concurrent Support#200

Open
trivenay wants to merge 3 commits intoaws:mainfrom
trivenay:main
Open

Add Lambda Managed Instances (LMI) / Multi-Concurrent Support#200
trivenay wants to merge 3 commits intoaws:mainfrom
trivenay:main

Conversation

@trivenay
Copy link
Contributor

@trivenay trivenay commented Feb 18, 2026

_Issue #, if available: NA

_Description of changes:
This PR adds support for Lambda Managed Instances (LMI), enabling multi-concurrent execution in the Python Runtime Interface Client via multi-processing

Changes

Core Features:

  • Add MultiConcurrentRunner class to handle multi-concurrent Lambda execution
  • Add LambdaMultiConcurrentRuntimeClient with retry logic and error suppression for concurrent workers
  • Add configuration support for AWS_LAMBDA_MAX_CONCURRENCY and socket path environment variables
  • Implement stdout/stderr redirection via Unix sockets for concurrent processes

Major changes:

  • awslambdaric/lambda_multi_concurrent_utils.py - Multi-concurrent runner implementation
  • awslambdaric/__main__.py - Entry point routing for multi-concurrent mode
  • awslambdaric/lambda_config.py - New config properties (is_multi_concurrent, lmi_socket_path)
  • awslambdaric/lambda_runtime_client.py - LMI client for Runtime API

Testing

make test 

Name                                            Stmts   Miss  Cover   Missing
-----------------------------------------------------------------------------
awslambdaric/__init__.py                            1      0   100%
awslambdaric/__main__.py                           18      1    94%   33
awslambdaric/bootstrap.py                         260     11    96%   107-114, 351, 354, 357, 510-519
awslambdaric/lambda_config.py                      45      0   100%
awslambdaric/lambda_context.py                     57      4    93%   60, 80, 98, 113
awslambdaric/lambda_literals.py                     2      0   100%
awslambdaric/lambda_multi_concurrent_utils.py      31      0   100%
awslambdaric/lambda_runtime_client.py             126      5    96%   30, 116, 135, 152-153
awslambdaric/lambda_runtime_exception.py           16      0   100%
awslambdaric/lambda_runtime_hooks_runner.py        10      0   100%
awslambdaric/lambda_runtime_log_utils.py           56      0   100%
awslambdaric/lambda_runtime_marshaller.py          35      0   100%
-----------------------------------------------------------------------------
TOTAL                                             657     21    97%

Required test coverage of 90% reached. Total coverage: 96.80%

============================= 123 passed in 0.79s ==============================

_Target (OCI, Managed Runtime, both): Both

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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

Comments