Repository navigation
refactor: gate client route publication quiescence - #11266
Conversation
There was a problem hiding this comment.
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.
Code coverage
Report-only conclusion: improved. The current-main baseline is commit 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 |
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