Skip to content

Align durable Parallel/Map failure semantics with the JS SDK#2465

Draft
GarrettBeatty wants to merge 1 commit into
devfrom
durable-concurrent-js-parity
Draft

Align durable Parallel/Map failure semantics with the JS SDK#2465
GarrettBeatty wants to merge 1 commit into
devfrom
durable-concurrent-js-parity

Conversation

@GarrettBeatty

Copy link
Copy Markdown
Contributor

Summary

Brings ParallelAsync/MapAsync in Amazon.Lambda.DurableExecution to full parity with the JS reference SDK's concurrent-operation failure semantics. Verified against all four SDK clones (JS/Python/Java) and the canonical aws-durable-execution-docs spec.

Preview (0.x) — intentionally backward-incompatible.

Changes

  1. No auto-throw. ParallelAsync/MapAsync now always return IBatchResult. Failure surfaces via CompletionReason / HasFailure / ThrowIfError() — matching JS, Python, and Java. Previously the failure-tolerance path threw.
  2. Removed ParallelException and MapException. No SDK has a batch-level exception; ThrowIfError() throws the individual child error.
  3. Empty CompletionConfig() is now fail-fast (any failure → FailureToleranceExceeded), matching JS/Python getCompletionReason. AllCompleted() is redefined to ToleratedFailureCount = int.MaxValue so it stays lenient after the flip. Map's default completion flipped from AllCompleted() to AllSuccessful(), matching Parallel and JS/Python.
  4. MapConfig is now generic (MapConfig<TItem>) so ItemNamer is typed Func<TItem, int, string> instead of Func<object, int, string>.

Also corrects a stale doc statement that NestingType.Flat throws NotSupportedException (Flat is implemented).

Cross-SDK context

SDK Parallel default Map default Auto-throws?
JS fail-fast fail-fast no
Python all_successful empty = fail-fast (all_completed() deprecated) no
Java allCompleted() allCompleted() no (future/.get() summary API)
.NET (this PR) AllSuccessful() AllSuccessful() no

.NET now matches JS+Python exactly. Java remains an outlier by its own design (both defaults lenient, no ItemNamer).

Testing

  • Library + all test projects build clean (TreatWarningsAsErrors on, 0 warnings).
  • 405 unit tests and 153 testing-shared tests pass, including both failure-tolerance scenarios exercised end-to-end through the in-memory runner.
  • Integration tests (live-AWS) were rewritten for the new contract and compile; not run here.

Change file

.autover/changes/durable-concurrent-js-parity.json (Minor, preview).

Full JS-SDK parity for ParallelAsync/MapAsync (preview 0.x, breaking):

- No auto-throw: both operations always return IBatchResult; failure
  surfaces via CompletionReason/HasFailure/ThrowIfError(), matching
  JS/Python/Java.
- Removed ParallelException and MapException.
- Empty CompletionConfig() is now fail-fast (any failure resolves
  FailureToleranceExceeded), matching JS/Python getCompletionReason.
  AllCompleted() redefined to ToleratedFailureCount = int.MaxValue so it
  stays lenient. Map default flipped from AllCompleted() to
  AllSuccessful().
- MapConfig is now generic (MapConfig<TItem>) so ItemNamer is typed
  Func<TItem, int, string> instead of Func<object, int, string>.

Updates all consumers (context, config, ops, docs, analyzer stubs,
shared workflows/scenarios, unit + integration tests). Also corrects a
stale docs claim that NestingType.Flat throws NotSupportedException.

405 unit tests and 153 testing-shared tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant