Repository navigation
fix: forward cancellation tokens in DynamoDB grain storage - #11410
ReubenBond merged 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Cancellation is consistently forwarded, state mutations occur only after successful requests, and the behavior has thorough regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds cancellation-token support to DynamoDB grain persistence while preserving legacy behavior and state consistency.
Changes:
- Forwards cancellation tokens through read, write, clear, and AWS SDK operations.
- Adds comprehensive cancellation and ETag regression tests.
- Documents behavior and updates the generated API surface.
| File | Description |
|---|---|
DynamoDBGrainStorageCancellationTests.cs |
Tests token forwarding, cancellation, concurrency failures, and state transitions. |
README.md |
Documents cancellation semantics. |
DynamoDBGrainStorage.cs |
Implements cancellation-aware storage overloads. |
Orleans.Persistence.DynamoDB.cs |
Records the new public overloads. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage
Report-only conclusion: improved. The current-main baseline is commit Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
) (cherry picked from commit d2f8024) Upstream-PR: dotnet#11410 Upstream-Commit: d2f8024
DynamoDB grain storage currently falls back to the default
IGrainStoragetoken overloads, which delegate to the legacy methods and lose the caller's cancellation token.Implement cancellation-aware read, write, and clear overloads and forward the exact caller token through the existing DynamoDB helper to AWS SDK get, put, update, and delete requests. Legacy methods delegate with
CancellationToken.None. Pre-canceled operations stop before serialization or storage access; SDK cancellation propagates while retaining the supplied state, ETag, and record-existence flag. Successful operations retain existing optimistic-concurrency and clear/delete semantics.Add deterministic provider-level regression coverage for every new/existing ETag and clear/delete branch, legacy overloads, pre-cancellation, in-flight cancellation, conditional failures, and missing/cleared reads. Regenerate the public API surface using the repository's GenAPI target.
Microsoft Reviewers: Open in CodeFlow