Repository navigation
v4: group methods forward their CancellationToken through every private core - #3425
Merged
Merged
Conversation
…te core SearchAsync/SearchAndStoreAsync (geo), FieldAsync (bitmaps), SortAsync/ SortAndStoreAsync, SimilaritySearchAsync (vector sets), and the list push and multi-key pop methods all accepted a token and dropped it: their private cores had no token parameter and sent with default. The cores now take the token and pass it on; the internal array forms behind the legacy IDatabase methods, which have no token, pass CancellationToken.None explicitly. CancellationForwardingTests records the token each send receives; all ten fail without the fix.
philon-msft
approved these changes
Dec 4, 2026
This was referenced Dec 4, 2026
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.
Several group methods accepted a
CancellationTokenand dropped it before sending. They hand off to a private core that had no token parameter, and that core calledSendAsync(..., default). So cancelling had no effect.Fixed:
Geospatial.SearchAsyncandSearchAndStoreAsync(SearchCore)Bitmaps.FieldAsync(FieldCore)Keys.SortAsyncandSortAndStoreAsync(SortCore)VectorSets.SimilaritySearchAsync(SimilaritySearchCore)Lists.LeftPushAsync/RightPushAsync(single and span forms) and the multi-keyLeftPopAsync/RightPopAsync(Push,MultiPop)Each core now takes the token and passes it on. The internal array forms behind the legacy
IDatabasemethods have no token to forward, so they passCancellationToken.Noneexplicitly.How they were found: the first five came from a search for
SendAsync(..., default). The Lists ones came from a second pass for methods that take acancellationTokenparameter and never use it. The remaining hits from that pass are either default virtuals with nothing to cancel, or connection-level code (handshake, dial) where the token governs connect timeouts. I've left those for a separate change.Tests:
CancellationForwardingTestsrecords the token each send actually receives and asserts it's the caller's. All 10 fail without the fix. The existing Geo/Sort/Bit/VectorSet/List/Cancel suites pass (727 passed, 5 skipped).