Repository navigation
fix: deactivate existing grains without activating them - #11483
Conversation
Code coverage
Report-only conclusion: mixed. 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 |
815fea5 to
638d8f8
Compare
638d8f8 to
863df35
Compare
ReubenBond
left a comment
There was a problem hiding this comment.
Reviewed the management-to-silo boundary, activation-directory lookup, activation/deactivation lifecycle, stateless-worker teardown, cancellation ownership, and generated API/contract changes. No blocking findings. The silo-side operation uses the existing context's lifecycle and waits for teardown; it avoids the stale-address grain-RPC activation race. The application-requested deactivation reason is correct. All four focused ManagementDeactivationTests passed locally on net8.0 and net10.0, including three additional complete-class repeats on each framework (32 passing executions total). CI is green for head 863df35. The coverage report shows 83.57% overall line coverage; affected-code coverage is not separately reported. Ready for the preview release.
(cherry picked from commit 3a33a53) Retain only the explicitly approved management-member CP0006 suppression for each target framework, regenerated against 10.4.0, and document the all-active-silos rollout gate. Upstream-PR: dotnet#11483 Upstream-Commit: 3a33a53
(cherry picked from commit 3a33a53) Retain only the explicitly approved management-member CP0006 suppression for each target framework, regenerated against 10.4.0, and document the all-active-silos rollout gate. Upstream-PR: dotnet#11483 Upstream-Commit: 3a33a53
Management callers cannot safely deactivate an existing grain by resolving its activation address and invoking the management extension: a stale address or a concurrent deactivation can turn the extension RPC into a new activation, which reads persisted state. This prevents lifecycle operations from safely handling unreadable state.
Add
IManagementGrain.DeactivateGrain(GrainId, CancellationToken). The management grain asks each active silo's system target to inspect its activation registry and deactivate the matching context directly. Missing contexts are a no-op; stateless workers are included. Completion waits for the matching deactivation callbacks. Once deactivation is requested, cancellation stops waiting without cancelling teardown. Ordinary later calls can still activate the grain.The change includes the generated wire manifest and public API, plus package-scoped CP0006 suppressions for the new interface member. Four focused lifecycle regressions pass on both net8.0 and net10.0. The normal Release pack succeeds; baseline APICompat also reports reference-resolution warnings for Microsoft.AspNetCore.Connections.Abstractions and Microsoft.Extensions.Features. Automated PR coverage is not available yet.
Fixes #11482.
Microsoft Reviewers: Open in CodeFlow