feat: add custom extension operations API - #607
Conversation
03121c7 to
a73d2d0
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
# Conflicts: # sdk-integration-tests/src/test/java/software/amazon/lambda/durable/PluginIntegrationTest.java # sdk/src/main/java/software/amazon/lambda/durable/execution/DurableExecutor.java # sdk/src/main/java/software/amazon/lambda/durable/plugin/PluginInfoConverter.java # sdk/src/test/java/software/amazon/lambda/durable/plugin/PluginInfoConverterTest.java
This comment has been minimized.
This comment has been minimized.
| Throwable throwable) { | ||
| var cause = software.amazon.lambda.durable.util.ExceptionHelper.unwrapCompletableFuture(throwable); | ||
| if (cause instanceof SuspendExecutionException || cause instanceof UnrecoverableDurableExecutionException) { | ||
| return CompletableFuture.failedFuture(cause); |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_efufskzwapiifaigbhd53nhmx6
[P1] Preserve the durable context across backoff completion. When another durable thread remains active, this wait can complete in-process on a polling/checkpoint thread. The continuation then calls executeRetryLoop(), which reads thread-local context and fails with IllegalStateException instead of starting the next attempt. Resume via a context-aware executor that restores the child durable context and logical thread state, or explicitly capture and restore both. Add an integration test with retry backoff and a concurrently running sibling operation.
| ignored -> | ||
| CompletableFuture.completedFuture(ExtensionStepResult.succeed(function.get())), | ||
| extensionConfig(config))); | ||
| } |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_wleseolejcs67e5dfazmlwepne
[P2] Preserve zero-delay custom retry strategies. RetryDecision.retry(null) produces Duration.ZERO, and the previous step implementation accepted zero-second delays, but ExtensionStepResult.retry rejects durations below one second. Existing custom StepConfig retry strategies can therefore terminate the execution with a validation exception instead of retrying. Either retain immediate-retry support in the extension result or normalize zero to the intended supported delay before constructing it, and add a regression test for null/zero retry delays.
Codex AI reviewFound two retry-related regressions affecting in-process backoff and existing zero-delay retry strategies. Reviewed commit |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
Closes #571
Description
ExtensionContextandExtensionOperationSPI for composing SDK-owned durable primitives with stable reservations, custom subtypes, stateful step replay, and configurable child contexts.Durable*Operationfacades and move backend engines into theprimitivepackage.DurableContext,ParallelDurableFuture, and compatibility config APIs.Demo/Screenshots
Not applicable. This change adds Java SDK APIs and internal architecture; no visual interface is changed.
Checklist
Testing
Unit Tests
Yes. Added and updated unit coverage for extension reservations, stateful steps, child-context replay, operation facades/config conversion, primitive implementations, deterministic IDs, plugin metadata, and compatibility APIs.
Full SDK result: 1,202 tests passed.
Integration Tests
Yes. Added integration coverage for extension operations, static operation facades, extension concurrency, plugins, replay, callbacks, retries, map, and parallel behavior.
Full integration result: 413 tests passed.
Examples
No new example was required. Existing examples remain source-compatible and passed their test suite: 120 tests passed, with 34 cloud-only tests skipped by default.
Verification command:
The OpenTelemetry module also passed 163 tests. Spotless and diff checks pass.