Repository navigation
fix: forward cancellation tokens in ADO.NET grain storage - #11413
Merged
ReubenBond merged 2 commits intoOct 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently forwards tokens and provides comprehensive regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds cancellation-token propagation to ADO.NET grain storage operations.
Changes:
- Adds token-aware read, write, and clear overloads.
- Preserves cancellation semantics, logging, and state metadata.
- Adds comprehensive cancellation tests and documentation.
| File | Description |
|---|---|
AdoNetGrainStorageCancellationTests.cs |
Tests token forwarding and cancellation boundaries. |
Orleans.Persistence.AdoNet.cs |
Updates generated public API surface. |
AdoNetGrainStorage.cs |
Forwards cancellation tokens to relational queries. |
README.md |
Documents cancellation behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Code coverage
Report-only conclusion: regressed. The current-main baseline is commit 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 |
ReubenBond
added a commit
to ReubenBond/orleans
that referenced
this pull request
Oct 22, 2026
(cherry picked from commit ec48d17) Upstream-PR: dotnet#11413 Upstream-Commit: ec48d17
ReubenBond
added a commit
that referenced
this pull request
Oct 23, 2026
This was referenced Oct 29, 2026
This was referenced Nov 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The runtime passes cancellation tokens through
IGrainStorage, but ADO.NET grain storage inherited the interface defaults and passedCancellationToken.Noneto relational queries. Caller cancellation therefore never reached the database driver.Solution
Implement token-aware read, write, and clear overloads and route the legacy overloads through
CancellationToken.None. Forward the exact caller token to each relational query, including clear's prerequisite read and both clear/delete modes. Reject pre-canceled operations before provider work, and propagate caller cancellation intact while retaining error logging for storage failures.Successful SQL results retain the existing state/ETag updates. A successful prerequisite read also retains its loaded state if the subsequent clear is canceled. Add deterministic provider-scoped regressions for these boundaries and regenerate the public API surface using the official GenAPI target.
Microsoft Reviewers: Open in CodeFlow