fix: Propagate cancellation exceptions during response buffering - #2284
Merged
glennawatson merged 1 commit intoAug 1, 2026
Merged
Conversation
glennawatson
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this - the bug is real and correctly located, and the product change is nicely minimal.
A few things to sort first:
- CI is red because of this change.
SendAsyncRethrowsCancellationRequestedDuringDeserializationfails on net9.0 and net11.0. Reproduced locally. - The new test passes without the product fix, so it does not guard the regression. Verified by reverting
RequestExecutionHelpers.csto main and re-running. - The fix is a no-op on net8.0 and below, because the
LoadIntoBufferAsyncpolyfill discards the token. - The
SuppressMessageshould be two doc comments instead. - The docs entry belongs in a new V15 section, not V14.
Suggestions inline for each.
glennawatson
force-pushed
the
rethrow-cancellation-exception-while-buffering
branch
from
August 1, 2026 14:43
5594252 to
49d3174
Compare
Contributor
|
Thanks for this - the bug is real. I have rebased onto latest main and pushed the review points to your branch, keeping you as the author. What changed from your version:
Result is 58 added lines across 3 files. Solution builds clean on all ten target frameworks, all 7505 tests pass, and |
glennawatson
approved these changes
Aug 1, 2026
glennawatson
enabled auto-merge (squash)
August 1, 2026 14:54
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What kind of change does this PR introduce?
Bug fix
What is the new behavior?
Caller cancellation during response buffering is propagated. Non-cancellation buffering failures remain best-effort.
What is the current behavior?
If a request is cancelled while deserializing the response, the cancellation exception is swallowed, allowing deserialization of a partially consumed stream.
What might this PR break?
None
Checklist
I have read the Contribute guide
Tests have been added or updated (for bug fixes / features)
Docs have been added or updated (for bug fixes / features)
Changes target the
mainbranchPR title follows Conventional Commits
Additional information
Added a regression coverage test