Fix durable execution conformance issues found via cross-SDK testing#2473
Draft
GarrettBeatty wants to merge 1 commit into
Draft
Fix durable execution conformance issues found via cross-SDK testing#2473GarrettBeatty wants to merge 1 commit into
GarrettBeatty wants to merge 1 commit into
Conversation
Fixes five behavioral bugs in the DurableExecution operations, surfaced by running the multi-language conformance suite against the .NET SDK and comparing against the JS/Python/Java reference SDKs. 1. ConcurrentOperation: emit ParentId on the parent CONTEXT START/SUCCEED checkpoints. Every other operation type sets ParentId; parallel/map did not, which dropped the parent linkage for a nested parallel/map (its child events lost their ParentId). 2. CallbackOperation: emit ParentId on the callback START checkpoint. Nested callbacks (e.g. the inner callback of a WaitForCallback) lost their ParentId. 3. WaitForConditionOperation: emit a fresh StepStarted before every poll iteration (not just the first). On resume the persisted status is READY/PENDING, so each poll now gets its own START, matching the Python/JS/Java SDKs. The only skip is when status is already STARTED (crash-recovery: the original START is authoritative). 4. WaitForConditionOperation: make the START checkpoint fire-and-forget instead of awaiting it. Awaiting forced two back-to-back synchronous flushes (START then terminal FAIL) with no suspension when the check throws on the first attempt, which could hang the invocation. Mirrors StepOperation and the reference SDKs; replay correctness relies only on the terminal RETRY/SUCCEED/FAIL checkpoints. 5. ConcurrentOperation/BatchResult: exclude never-dispatched branches from the user-facing All list so TotalCount = started(in-flight) + succeeded + failed, matching the JS SDK (same bug tracked in Python issue #279). A dispatched-then-bailed (genuinely in-flight) branch still appears as Started. The completion policy still reasons over the declared branch count (so ToleratedFailurePercentage and the early-stop signal are unchanged), and the persisted checkpoint summary still records every declared unit for replay/reconstruct. Replay/reconstruct paths updated to keep the reconstructed All consistent with the fresh run. Updated the affected Parallel/Map operation unit tests to reflect the corrected never-dispatched semantics (dispatched-then-bailed cases are unchanged).
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.
Summary
Fixes five behavioral bugs in the
Amazon.Lambda.DurableExecutionoperations, surfaced by running the multi-language durable-execution conformance suite against the .NET SDK and comparing the emitted execution history / results against the JS, Python, and Java reference SDKs.All five were confirmed as divergences from the reference SDKs (one matches a known open bug in the Python SDK, issue #279).
Fixes
ConcurrentOperation— missingParentIdon parent CONTEXT checkpoints. Parallel/Map did not setParentIdon theirSTART/SUCCEEDcheckpoints (every other operation type does). This dropped the parent linkage for a nested parallel/map — its child events lost theirParentId.CallbackOperation— missingParentIdon the callbackSTART. Nested callbacks (e.g. the inner callback created byWaitForCallbackAsync) lost theirParentId.WaitForConditionOperation—StepStartedonly emitted on the first poll. Now emits a freshStepStartedbefore every poll iteration, matching Python/JS/Java. On resume the persisted status isREADY/PENDING, so each poll gets its ownSTART; the only skip is when the status is alreadySTARTED(crash-recovery, where the originalSTARTis authoritative).WaitForConditionOperation—STARTcheckpoint was awaited instead of fire-and-forget. Awaiting it forced two back-to-back synchronous flushes (STARTthen terminalFAIL) with no suspension when the check throws on the first attempt, which could hang the invocation. Now fire-and-forget, mirroringStepOperationand the reference SDKs. Replay correctness depends only on the terminalRETRY/SUCCEED/FAILcheckpoints.ConcurrentOperation/BatchResult—TotalCountcounted never-dispatched branches. Never-dispatched branches (skipped by aCompletionConfigshort-circuit before they ever started) are now excluded from the user-facingAlllist, soTotalCount = started(in-flight) + succeeded + failed, matching the JS SDK (same bug as Python Support for Binary Data using Razor Pages #279). A dispatched-then-bailed (genuinely in-flight) branch still appears asStarted. The completion policy still reasons over the declared branch count (soToleratedFailurePercentageand the early-stop / min-successful signal are unchanged), and the persisted checkpoint summary still records every declared unit for replay/reconstruct. The replay and reconstruct paths were updated to keep the reconstructedAllconsistent with the fresh run.Tests
Updated the affected
ParallelOperationTestsandMapOperationTeststo reflect the corrected never-dispatched semantics. Dispatched-then-bailed (in-flight) cases are deliberately unchanged. All 72 parallel + map operation unit tests pass.Validated end-to-end against the conformance harness: all implementable .NET conformance tests pass across step, wait, callback, child, invoke, parallel, wait_for_callback, and wait_for_condition operations.