-
Notifications
You must be signed in to change notification settings - Fork 11
fix(plugin): surface missing state fields on hook info records #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| package software.amazon.lambda.durable.plugin; | ||
|
|
||
| import java.time.Instant; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Invocation-level information available to plugin hooks. | ||
|
|
@@ -12,8 +13,19 @@ | |
| * @param isFirstInvocation true if this is the first invocation of the execution (not a replay invocation) | ||
| * @param executionStartTime the start timestamp of the durable execution, taken from the initial EXECUTION operation in | ||
| * the first event delivered by the backend. Stable across all invocations of the same execution. | ||
| * @param operations a snapshot of the checkpointed operations delivered at the start of this invocation, keyed by | ||
| * operation ID. Includes the initial EXECUTION operation. Empty-but-never-null. | ||
| * @param updatedOperations the subset of {@code operations} that changed externally between the previous invocation and | ||
| * this one (a wait timer expired, a callback was received, a chained invoke completed), keyed by operation ID. | ||
| * Sourced from the {@code UpdatedOperationIds} field of the durable invocation input, so it is empty on the first | ||
| * invocation. Empty-but-never-null. | ||
| * @deprecated This is a preview API that is experimental and may be changed or removed in future releases. | ||
| */ | ||
| @Deprecated | ||
| public record InvocationInfo( | ||
| String requestId, String durableExecutionArn, boolean isFirstInvocation, Instant executionStartTime) {} | ||
| String requestId, | ||
| String durableExecutionArn, | ||
| boolean isFirstInvocation, | ||
| Instant executionStartTime, | ||
| Map<String, OperationChangeItemInfo> operations, | ||
| Map<String, OperationChangeItemInfo> updatedOperations) {} | ||
|
Comment on lines
+29
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codex AI review [P1] The invocation payload fields are still missing. Plugins still cannot inspect the deserialized execution input or the successful handler result. Add |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codex AI review
[P2] Avoid materializing operation maps when no plugins are configured. Java evaluates these conversions before the no-op runner is called, so every default invocation now copies the full execution state multiple times and reconstructs exceptions for failed operations. This can materially increase Lambda memory and duration for long histories. Guard both invocation hooks with
pluginRunner.isEmpty()before creating snapshots.