feat: add per-invocation executor isolation - #735
Draft
zhongkechen wants to merge 3 commits into
Draft
zhongkechen wants to merge 3 commits into
zhongkechen wants to merge 3 commits into
Conversation
added 3 commits
September 25, 2026 02:10
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link, if available
Partial fix for #726, covering LMI cross-invocation executor isolation. Stacked on #733. Arbitrarily nested bounded-pool starvation remains a separate baseline concern.
Description
This adds an explicit, non-breaking way to give each Lambda invocation its own user-code executor while preserving the existing shared-executor contract.
DurableConfig.withInvocationExecutorFactory(...). The factory may be called concurrently on Lambda Managed Instances and must return a fresh, non-null, non-shutdownExecutorServicefor each invocation.withExecutorService(...)unchanged: its executor remains caller-owned, shared by every invocation using the config, and is never shut down by the SDK. Configuring both options is rejected.shutdownNow()only for the SDK-owned executor when tasks or termination remain; never apply it to a shared executor.LocalDurableTestRunnercopies customer configuration, so every replay/resume gets a new executor and closes it before returning.fixed2fixture to use invocation-local fixed(2) pools. Keep the existingnested2shared-fixed resource for baseline diagnostics but remove it from LMI pass/fail gating.This PR targets
fix/lmi-invocation-lifecycle, the head branch of #733. It should be retargeted tomainafter #733 lands.Compatibility
withExecutorService()applications retain the same threads, sharing, and lifecycle behavior.withInvocationExecutorFactory().Testing
mvn test— all 10 reactor modules passed. The SDK ran 1,185 tests with 3 default-skipped opt-in tests; sdk-testing ran 15, integration tests ran 405, OTel ran 220, Insight ran 144, and examples ran 103 with 31 cloud tests disabled.mvn -pl sdk,sdk-testing,lmi-tests spotless:check— passed.mvn -pl lmi-tests -am -DskipTests package— LMI shaded fixture built successfully.mvn -pl sdk -Dtest=LmiLifecycleRegressionTest -Dtest.lmi.regressions.enabled=true test— 3/3 passed, including two concurrent roots using isolated fixed(2) executors.python3 -m unittest discover -s lmi-tests/tests— 41/41 passed.WaitForConditionOperationlink warnings.Cloud LMI execution was not run locally because it requires the configured persistent capacity provider. The updated
fixed2fixture is wired into #728's opt-in cloud workflow.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.