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