Repository navigation
feat(lambda): initialize provisioned concurrency environments - #6320
Conversation
PR Summary by QodoInitialize and route Lambda provisioned concurrency environments
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
Integrated from floci-io#6320 at a975b17. Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
Code Review by Qodo
1.
|
pgermosen
left a comment
There was a problem hiding this comment.
@AndreKurait thanks, this stage reads well: launches and Docker stops run outside the pool lock, a replaced or deleted allocation keeps its leased environments until they're released, and capacity counts what is still being torn down.
One small thing: a failed stop is logged with "Could not stop provisioned Lambda environment " + handle.getContainerId(), and AGENTS.md asks for the parameterized form instead: LOG.warnv(failure, "Could not stop provisioned Lambda environment {0}", handle.getContainerId()).
Integrated from floci-io#6320 at a975b17. Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
Initialize and route qualifier-owned provisioned environments without invoking handlers during initialization. Keep configuration outcomes committed while failed removal remains owned for retry, and bound cleanup after late invocation release. Preserve on-demand spillover and the separate alias-retargeting stage. Signed-off-by: Andre Kurait <[email protected]>
a975b17 to
d2d777e
Compare
|
@pgermosen Fixed the failed-stop log in d2d777e using LOG.warnv with the original cause and parameterized container ID. The same revision addresses both cleanup findings: committed configuration outcomes survive failed/inflight removal, and late invocation releases receive bounded cleanup after shutdown. 463 focused JVM cases, package and static gates pass; seven fault/race controls reproduced the prior behavior. I retained the bounded readiness helper: reconcile schedules initialization workers but does not join them, and completing the fake runtime barrier only lets those workers continue. An immediate READY assertion would race their publication under the pool lock. The helper observes a positive completion condition; it is not a fixed sleep or an absence-window assertion. |
Integrated from floci-io#6320 at d2d777e. Integrated from floci-io#6320 at a975b17. Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
Integrated from floci-io#6320 at d2d777e. Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
pgermosen
left a comment
There was a problem hiding this comment.
@AndreKurait thanks, the logging is parameterized now, a committed Put or Delete stays committed while a failed removal is retried, and a late release after shutdown still gets its own bounded cleanup.
All original functionality landed through floci-io#6299, floci-io#6317, floci-io#6320 and floci-io#6335. Preserve accepted upstream behavior; the original history is backed up. Signed-off-by: Andre Kurait <[email protected]>
Summary
Adds runtime initialization and invocation routing to the provisioned-concurrency configuration APIs from #6317, as the next requested split from #6210.
Put starts owned Docker environments without invoking the handler. Get reports actual initialization and available capacity. Invocations for the configured qualifier use initialized environments, with on-demand spillover when they are busy. Initialization failures remain visible, and replacement, deletion, reset, and shutdown retire owned environments.
Automatic alias allocation retargeting remains a separate final stage. In this stage, changing the alias version marks its old allocation FAILED and retires it; invocation uses on-demand capacity until an explicit Put initializes the new version. The requested quota remains accounted for. The original implementation and retarget tests remain preserved on #6210.
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Keeps the existing AWS REST JSON operations and qualified IAM mapping. Provisioned runtimes expose
AWS_LAMBDA_INITIALIZATION_TYPE=provisioned-concurrency. Initialization waits for runtime readiness rather than sending a synthetic handler invocation. Unsupported executor and target restrictions remain documented.Validation on current main: 463 focused JVM cases, including the SAM alias consumer, packaging, full Checkstyle, documentation, partition and diff checks passed. Seven fault/race controls reproduced the cleanup findings on the preceding head. Configuration replacement and deletion now retain their committed outcomes while failed or concurrent removals remain owned for retry. A late invocation release joins the remaining shutdown budget or starts its own bounded cleanup after that budget expires. The final expired-budget test uses the existing deadline API without sleeps or reflection.
Retained Docker evidence from the earlier extraction covers three boto3 scenarios: READY before the first handler call, repeated invocation reuse, qualifier isolation, explicit reconfiguration after an alias changes version, and deletion cleanup. All owned containers, volumes, network and test image were removed in that earlier run. Those Docker scenarios were not rerun for this cleanup correction; the new failure/concurrency paths are covered by deterministic JVM controls. Existing on-demand runtimes do not expose the initialization-type variable; this stage preserves that behavior.
No full-suite, native-runtime, or new live AWS invocation proof is claimed. The control-plane live AWS comparison is described in #6317.
Checklist
./mvnw testpasses locally (focused selection above; full suite not run)