Skip to content

refactor: gate client route publication quiescence - #11266

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-refactor-gate-client-route-publication
Sep 16, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-refactor-gate-client-route-publication

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

ClientDirectory tracks each accepted route publication through a per-publication completion source and a last-inflight task so shutdown can join the actual RPC after its cancellable wait ends.

Replace that bridge with the shared AdmissionGate. Admission is acquired before the registration hook, transferred to the returned RPC task, and released on actual completion. Pre-RPC shutdown and synchronous failures release admission locally. Quiescence closes admission before signaling cancellation, retains the scheduled-publication and run-loop joins, and drains accepted publications using the existing caller cancellation policy.

Publication coalescing, routing-table/version state, exception observation, and the Active/RuntimeGrainServices lifecycle stages remain intact. Focused regressions cover pre-RPC stop and hook failure, synchronous and returned-task failure with retry, actual RPC success/failure/cancellation after wrapper cancellation, repeated/cancelled quiescence, and late publication requests.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings September 16, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Reviewed changes and coverage address the publication lifecycle and shutdown scenarios.

Review tier: Lite
Findings: None

What changed in this PR

Refactors ClientDirectory publication tracking to use AdmissionGate, ensuring quiescence waits for actual RPC completion.

Changes:

  • Transfers admission ownership to publication tasks.
  • Handles shutdown and synchronous failure paths.
  • Adds regression coverage for cancellation, failures, retries, and late publications.
File Summary
test/​Orleans.Core.Tests/​Directory/​ClientDirectoryTests.cs Adds coverage for publication lifecycle and shutdown scenarios.
src/​Orleans.Runtime/​GrainDirectory/​ClientDirectory.cs Implements admission-gated publication and quiescence draining.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request Current main Variance
Lines 81.91% (111,297 / 135,875) 81.87% (111,253 / 135,883) +0.0372 pp
Branches 70.97% (31,876 / 44,912) 70.93% (31,854 / 44,912) +0.0490 pp

Report-only conclusion: improved.

The current-main baseline is commit 8c4887aba9 and uses the same reviewed coverage matrix.

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
ReubenBond marked this pull request as ready for review September 16, 2026 01:12
@ReubenBond
ReubenBond merged commit 079c07f into dotnet:main Sep 16, 2026
73 checks passed
@ReubenBond
ReubenBond deleted the rb-refactor-gate-client-route-publication branch September 16, 2026 01:43
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants