GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — fix(runtime): preserve rebalancer state on shutdown by ReubenBond · Pull Request #10573 · dotnet/orleans Conversation
|
| File | Description |
|---|---|
| test/Orleans.Placement.Tests/ActivationRebalancingTests/StatePreservationRebalancingTests.cs | Refactors the regression test to coordinate on diagnostic events, validates migration/state preservation, and introduces helper for deterministic rebalancer relocation. |
| test/Orleans.Placement.Tests/ActivationRebalancingTests/RebalancingTestBase.cs | Wraps placement hint usage in try/finally to avoid RequestContext leakage during test activation creation. |
| src/Orleans.Runtime/Placement/Rebalancing/ActivationRebalancerMonitor.cs | Adds an earlier shutdown hook to migrate the rebalancer worker and await completion before bulk grain deactivation proceeds. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
test/Orleans.Placement.Tests/ActivationRebalancingTests/StatePreservationRebalancingTests.cs:145
MigrateOnIdle() initiates migration but does not wait for the source activation to deactivate/migrate. The immediate GetReport()/Assert.Equal can therefore race and intermittently observe the old host. Capture the current activation’s deactivation task before requesting migration and await it (similar to TestCluster.MigrateAsync/WaitForDeactivationAsync). RequestContext.Set(IPlacementDirector.PlacementHintKey, targetHost);
try
{
await rebalancer.Cast<IGrainManagementExtension>().MigrateOnIdle();
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Clear previously observed cycle events after the test load is created so the initial barrier only counts cycles which process that load. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8fc23ff9-c5c7-435c-91c5-e23f9b6dc452
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
test/Orleans.Placement.Tests/ActivationRebalancingTests/StatePreservationRebalancingTests.cs:152
MigrateOnIdle() only initiates migration (it calls Migrate(...) without awaiting deactivation/rehydration), so immediately asserting the new host here can reintroduce timing-based flakiness. Consider waiting (with a bounded timeout) until GetReport().Host actually reflects targetHost, and perform the assert on the final attempt for a clearer failure message. Assert.Equal(targetHost, (await rebalancer.GetReport()).Host);
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Flaky test: state-preserving migration does not leave dead silo
There was an error while loading. Please reload this page.