Skip to content

fix: forward cancellation tokens in Azure Table grain storage - #11415

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-flow-storage-cancellation-tokens
Oct 6, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-flow-storage-cancellation-tokens

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Azure Table grain storage currently inherits the cancellation overloads from IGrainStorage, which delegate to tokenless methods. Consequently, caller cancellation never reaches Azure Table requests.

Implement cancellation-aware read, write, and clear overloads and forward the caller token through the provider's data manager to SDK reads, inserts, conditional replacements, and deletes. Retain legacy overloads using CancellationToken.None, propagate caller-requested cancellation unchanged, and preserve existing diagnostics for SDK cancellation when the caller token remains uncanceled. Apply local grain-state changes after successful SDK completion.

Add deterministic regressions for exact token forwarding, legacy calls, pre-canceled and in-flight operations, all write/clear branches, state/ETag preservation, and the caller-versus-SDK cancellation distinction. Update existing shared-helper tests to use their cancellation-aware overloads and regenerate the provider API.

This PR contains only the Azure Table provider changes and is independently mergeable from the Azure Blob cancellation PR.

Microsoft Reviewers: Open in CodeFlow

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

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 across all storage branches with comprehensive regression coverage and preserved legacy behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Adds end-to-end cancellation support for Azure Table grain storage while preserving legacy overload behavior and state consistency.

Changes:

  • Forwards cancellation tokens through storage operations to Azure SDK calls.
  • Avoids error logging and state mutation when operations are canceled.
  • Adds comprehensive cancellation tests, API updates, and recovery guidance.
File Description
AzureTableGrainStorageCancellationTests.cs Tests token forwarding, cancellation branches, and state preservation.
AzureTableDataManagerTests.cs Uses cancellation-aware manager overloads.
AzureTableDataManager.cs Adds token-aware CRUD overloads.
README.md Documents cancellation semantics and recovery.
AzureTableStorage.cs Implements cancellation-aware grain storage operations.
Orleans.Persistence.AzureStorage.cs Regenerates the public API surface.

💡 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
Lines 83.18% (117,688 / 141,487)
Branches 72.65% (34,859 / 47,980)

Report-only conclusion: current-main baseline stale.

The newest successful coverage run tested b084e03, not current main 397e3b3.

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:40

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 propagated with comprehensive coverage for success, cancellation, legacy, and state-preservation paths.

Review effort: Balanced
Findings: None

@ReubenBond
ReubenBond merged commit cba3c01 into dotnet:main Oct 6, 2026
92 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-flow-storage-cancellation-tokens branch October 6, 2026 23:14
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 cba3c01)

Upstream-PR: #11415
Upstream-Commit: cba3c01
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