Skip to content

[10.x] fix(client): honor startup cancellation and release startup resources - #11605

Merged
ReubenBond merged 7 commits into
dotnet:10.xfrom
ReubenBond:rb-client-cancellation-backport
Oct 28, 2026
Merged

ReubenBond merged 7 commits into
dotnet:10.xfrom
ReubenBond:rb-client-cancellation-backport

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Backports #11604 to 10.x for 10.4.1. Fixes #11585.

Client startup observes cancellation through gateway-provider initialization and discovery, connection attempts, retry-filter decisions, and initial cluster-manifest retrieval. Runtime startup releases partially started resources before a cancelled start completes, because the client lifecycle begins after runtime startup succeeds. Gateway refreshes use the client's lifetime token.

Adds IGatewayListProvider.InitializeGatewayListProviderAsync(CancellationToken) and GetGatewaysAsync(CancellationToken) with default implementations for existing providers. Built-in providers forward cancellation through their storage operations and preserve resource ownership, including late-created Cassandra sessions and shared Cosmos clients. Existing tokenless signatures remain available, including the public DynamoDB scan overload; the four affected public API surfaces are regenerated with additive changes.

The manifest provider cancels and joins its owned background run when initialization is cancelled. Its local RPC waits observe cancellation independently of acknowledgement policy, while the runtime retains ownership of callbacks. Successful initialization detaches startup cancellation so subsequent refreshes follow the client lifetime; incomplete initialization propagates its actual failure or lifetime cancellation. Each serialized start attempt has fresh readiness completion, with cancellation remaining effective during run finalization. Retry-filter tasks have their eventual failures observed after cancellation ends the startup wait.

10.x adaptations use the keyed Microsoft.AspNetCore.Connections.IConnectionFactory regression seam, retain 10.x membership point-read coverage when combining provider fixtures, adapt callback instrumentation to 10.x constructors and its non-disposable Message, and grant Orleans.Core.Tests friend access to the internal in-process testing provider. The production cancellation semantics match main.

Deterministic regressions cover owned-run completion, acknowledgement boundaries, native provider cancellation, legacy compatibility, shared/owned resource cleanup, initialization retries, and continued refresh after successful startup. Normal Release package validation remains enabled with no added compatibility suppressions.

Release note: Orleans clients cancel provider initialization, gateway discovery, and initial manifest retrieval promptly while releasing owned startup resources and preserving gateway-provider compatibility.

@ReubenBond ReubenBond changed the title fix(client): honor startup cancellation in 10.4.1 [10.x] fix(client): honor startup cancellation and release startup resources Oct 27, 2026
@ReubenBond
ReubenBond force-pushed the rb-client-cancellation-backport branch from 0f270f6 to 39ae2ac Compare October 27, 2026 21:29
…ations

Backport of 08408c0. Regenerated the four affected public API surfaces on 10.x; the additive results match the main implementation.
…ility

Backport of 496bbbe. Preserve 10.x point-read coverage when merging provider fixtures. Adapt callback instrumentation to 10.x constructors and its non-disposable Message, and grant Core.Tests access to the internal in-process provider using the TestingHost friend-assembly pattern.
…lization retries

Backport of 15bf070. Each serialized manifest start attempt owns fresh readiness completion, finalization waits remain cancellable, and pending retry-filter faults are observed. Includes the required ADO.NET test token and focused retry regressions.
@ReubenBond
ReubenBond merged commit 7890777 into dotnet:10.x Oct 28, 2026
86 checks passed
@ReubenBond
ReubenBond deleted the rb-client-cancellation-backport branch October 28, 2026 16:48
This was referenced Oct 29, 2026
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.

1 participant