Skip to content

fix(rebalancing): honor latest suspension duration - #10614

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-timed-rebalancer-suspension
Aug 17, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-fix-timed-rebalancer-suspension

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Explicit suspension requests previously retained the later of the existing and requested deadlines. A shorter follow-up request could therefore report a duration greater than the caller requested.

Set the suspension deadline from the latest explicit request and add regression coverage for shortening and extending a suspension.

Fixes #10478

Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 15, 2026 17:27

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.

Pull request overview

This PR updates Orleans’ activation rebalancer suspension logic so that an explicit suspension request overwrites any prior explicit suspension deadline (instead of retaining the later deadline), and adds a regression test to validate shortening/extending behavior.

Changes:

  • Change ActivationRebalancerWorker.SuspendFor to set _suspendedUntilTs directly (honor latest explicit request).
  • Add a new regression test covering shortening and extending an explicit suspension duration.
Show a summary per file
File Description
test/Orleans.Placement.Tests/ActivationRebalancingTests/ControlRebalancerTests.cs Adds a regression test for latest explicit suspension duration semantics.
src/Orleans.Runtime/Placement/Rebalancing/ActivationRebalancerWorker.cs Updates suspension deadline assignment to reflect the latest explicit request.

Review details

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread test/Orleans.Placement.Tests/ActivationRebalancingTests/ControlRebalancerTests.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 16, 2026 09:09

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.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

test/Orleans.Placement.Tests/ActivationRebalancingTests/ControlRebalancerTests.cs:127

  • The test does not currently verify that the first (longer) suspension request actually took effect. If the initial call were ignored (or clamped), the rest of the test could still pass because it only asserts on the subsequent shorter/longer follow-up requests. Adding assertions on afterLongerCall makes the regression coverage stronger and ensures the scenario setup is valid.
        await rebalancer.SuspendRebalancing(longerDuration);
        var afterLongerCall = await rebalancer.GetRebalancingReport();

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ReubenBond
ReubenBond merged commit 2d2750d into dotnet:main Aug 17, 2026
135 of 137 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-timed-rebalancer-suspension branch August 17, 2026 20:57
This was referenced Aug 28, 2026
This was referenced Sep 7, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 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.

Flaky test: timed rebalancer suspension can report its full duration

2 participants