Repository navigation
feat(sdk): propagate chained invoke trace context in START checkpoints - #957
Draft
zhongkechen wants to merge 28 commits into
Draft
zhongkechen wants to merge 28 commits into
zhongkechen wants to merge 28 commits into
Conversation
2 of 3 tasks
Concurrent step retry wakeups may resume separately instead of coalescing into one invocation per attempt. Bound completed invocations by the initial invocation plus the six configured retry wakeups, retaining exact event signatures for every operation. Also require three starts and failures per step, their original terminal errors, FAILED execution status, and a throwing result accessor. Validated on Node 24 with all promise examples and controlled 3/4/7-invocation delivery; the old assertion reproduces the CI failure with four invocations.
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.
When a new
context.invoke()START is checkpointed, the SDK now collects optional plugin metadata and writes the calling operation’s X-Ray header to flatChainedInvokeOptions.XAmznTraceId. Each invoke in a batched checkpoint carries its own parent span. Existing function, tenant, payload, operation identity and persisted replay outcomes are preserved.The optional synchronous hook uses readonly SDK-owned input/result types. The collector keeps the first supported nonblank value, warns on conflicting later values and isolates ordinary failures. Both OTel views encode canonical Root/Parent/Sampled, including
Sampled=0, without creating an extra span. Checkpointed STARTs do not call the hook again; an uncommitted START may recompute on retry.Keep this PR draft pending the Lambda model and backend rollout. The SDK implementation assumes the new model field exists, as required by the design. The pinned
@aws-sdk/client-lambda3.1014.0 lacks it: the unchanged wire-model parity guard fails type checking, and the actual generated serializer drops the field. The new serializer regression test intentionally exposes this dependency. After model publication, update/rebase and rerun normal build, installed-consumer, serialization and deployed trace-topology checks. No type suppression, serializer bypass, model gate or test skip is added.Validation of this revision:
Existing registration APIs, provider API version and dependency floors remain unchanged. The declaration compatibility bridge from the earlier draft is retained; earlier released-package/layer checks are historical evidence and must be rerun after the model-dependent build is available. Integrate the coordinated minor PRs #956 and #955 before release. The separate #924 factory migration is not included. Shared CI prerequisite #959 remains in this branch.
The design also proposes
DistributedMapOptions.XAmznTraceId; there is no corresponding distributed-map START API in this SDK. Existing map/parallel use CONTEXT operations, and this PR does not invent that future API or its model structures.Refs #952; backend-dependent end-to-end delivery remains open. Coordinated SDK drafts: aws/aws-durable-execution-sdk-java#768 and aws/aws-durable-execution-sdk-python#755.