Skip to content

fix: forward cancellation tokens in DynamoDB grain storage - #11410

Merged
ReubenBond merged 3 commits into
dotnet:mainfrom
ReubenBond:rb-fix-forward-dynamodb-cancellation-tokens
Oct 6, 2026
Merged

ReubenBond merged 3 commits into
dotnet:mainfrom
ReubenBond:rb-fix-forward-dynamodb-cancellation-tokens

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

DynamoDB grain storage currently falls back to the default IGrainStorage token 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

Copilot AI balanced review requested due to automatic review settings October 6, 2026 21:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request Current main Variance
Lines 83.22% (117,744 / 141,479) 83.21% (117,720 / 141,473) +0.0134 pp
Branches 72.75% (34,873 / 47,938) 72.72% (34,858 / 47,934) +0.0252 pp

Report-only conclusion: improved.

The current-main baseline is commit b084e035b8 and uses the same reviewed coverage matrix.

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

Copilot AI balanced review requested due to automatic review settings October 6, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation correctly forwards cancellation tokens and includes thorough deterministic coverage.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 6, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation correctly forwards cancellation and includes thorough deterministic coverage.

Review effort: Balanced
Findings: None

@ReubenBond
ReubenBond merged commit d2f8024 into dotnet:main Oct 6, 2026
92 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-forward-dynamodb-cancellation-tokens branch October 6, 2026 23:16
ReubenBond added a commit to ReubenBond/orleans that referenced this pull request Oct 22, 2026
ReubenBond added a commit that referenced this pull request Oct 23, 2026
(cherry picked from commit d2f8024)

Upstream-PR: #11410
Upstream-Commit: d2f8024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants