Skip to content

fix: forward cancellation tokens in Azure Blob grain storage - #11411

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-forward-azure-blob-cancellation
Oct 6, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-forward-azure-blob-cancellation

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Azure Blob grain storage currently inherits the default cancellation-token overloads, which discard the caller's token and invoke tokenless operations.

Implement cancellation-aware read, write, and clear overloads and forward the caller's token through Blob downloads, uploads, deletion, clear-by-overwrite, container creation and retried writes, streaming serializers, and pooled/large-payload content reads. Legacy overloads delegate with CancellationToken.None.

Pre-canceled operations complete before accessing storage or changing grain state. Caller cancellation propagates the original OperationCanceledException while preserving the last-known state and avoiding storage-error logging; successful operations retain their ETag and record-status updates. Empty downloads dispose their response streams.

Add deterministic SDK-client regression coverage for token identity, pre-cancellation, in-flight SDK/serializer/content cancellation, container creation and retries, legacy overloads, optimistic concurrency, and empty/missing blob behavior. Regenerate the API surface with only the three Azure Blob overload additions.

Microsoft Reviewers: Open in CodeFlow

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

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 consistently forwards cancellation, preserves state on interruption, and includes thorough deterministic coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Adds cancellation-aware Azure Blob grain storage operations while preserving legacy overload behavior and grain-state consistency.

Changes:

  • Forwards cancellation tokens through storage, serialization, content reads, container creation, and retries.
  • Adds comprehensive cancellation regression tests.
  • Updates documentation and generated API surfaces.
File Description
AzureBlobGrainStorageCancellationTests.cs Adds cancellation and state-consistency tests.
README.md Documents cancellation behavior.
AzureBlobStorage.cs Implements cancellation-aware overloads and token forwarding.
Orleans.Persistence.AzureStorage.cs Records the three 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
Lines 83.22% (117,743 / 141,484)
Branches 72.70% (34,852 / 47,940)

Report-only conclusion: current-main baseline stale.

The newest successful coverage run tested 6bf11ad, not current main b084e03.

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 consistently forwards cancellation and is backed by comprehensive deterministic tests.

Review effort: Balanced
Findings: None

@ReubenBond
ReubenBond merged commit 5245374 into dotnet:main Oct 6, 2026
92 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-forward-azure-blob-cancellation branch October 6, 2026 23:15
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 5245374)

Upstream-PR: #11411
Upstream-Commit: 5245374
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