Skip to content

v4: group methods forward their CancellationToken through every private core - #3425

Merged
mgravell merged 1 commit into
v4from
marc/v4-cancel-sweep
Dec 4, 2026
Merged

mgravell merged 1 commit into
v4from
marc/v4-cancel-sweep

Conversation

@mgravell

@mgravell mgravell commented Dec 4, 2026

Copy link
Copy Markdown
Member

Several group methods accepted a CancellationToken and dropped it before sending. They hand off to a private core that had no token parameter, and that core called SendAsync(..., default). So cancelling had no effect.

Fixed:

  • Geospatial.SearchAsync and SearchAndStoreAsync (SearchCore)
  • Bitmaps.FieldAsync (FieldCore)
  • Keys.SortAsync and SortAndStoreAsync (SortCore)
  • VectorSets.SimilaritySearchAsync (SimilaritySearchCore)
  • Lists.LeftPushAsync / RightPushAsync (single and span forms) and the multi-key LeftPopAsync / RightPopAsync (Push, MultiPop)

Each core now takes the token and passes it on. The internal array forms behind the legacy IDatabase methods have no token to forward, so they pass CancellationToken.None explicitly.

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 a cancellationToken parameter 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: CancellationForwardingTests records 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).

…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.
@mgravell
mgravell merged commit 75992da into v4 Dec 4, 2026
4 of 5 checks passed
@mgravell
mgravell deleted the marc/v4-cancel-sweep branch December 4, 2026 21:39
mgravell added a commit that referenced this pull request Dec 4, 2026
…#3426)

The dropped-CancellationToken item becomes the connection-path leftovers the
#3425 sweep found (handshake, config-channel subscribe, PrepareRunAsync), to be
taken with the SYN-SENT item. Watch gains a ClusterTopologyUnitTests flake
and a fourth RespCacheChurnTests stall sighting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants