Repository navigation
fix: forward cancellation tokens in Azure Blob grain storage - #11411
Conversation
There was a problem hiding this comment.
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.
Code coverage
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 |
…11411) (cherry picked from commit 5245374) Upstream-PR: dotnet#11411 Upstream-Commit: 5245374
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
OperationCanceledExceptionwhile 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