Skip to content

fix: clean up rebalancer diagnostic waiters - #10313

Merged
ReubenBond merged 1 commit into
mainfrom
reubenbond-fix-rebalancer-waiter-race
Jul 31, 2026
Merged

ReubenBond merged 1 commit into
mainfrom
reubenbond-fix-rebalancer-waiter-race

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #10311 addressing valid post-merge review findings in the rebalancer diagnostic test observer.

Zero-duration waits now fault synchronously instead of depending on a thread-pool timer callback. Disposing an observer faults outstanding waiters and stops their timers so callbacks cannot outlive the observer. Timer ownership is kept directly on each waiter, with cleanup if scheduling fails.

The existing 30/60-second default waits remain unchanged and continue to rely on the test runner timeout for hangs.

Copilot AI review requested due to automatic review settings July 31, 2026 21:21

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 refines the rebalancer diagnostic test observer used in Orleans test infrastructure to make waiter behavior deterministic and safe under disposal, addressing review feedback from the prior fix (#10311). It ensures immediate, synchronous failures for zero-timeout waits and guarantees that disposing the observer completes and cleans up any outstanding waiters/timers.

Changes:

  • Make TimeSpan.Zero waits fault synchronously (no reliance on timer callbacks).
  • Add explicit disposal semantics: disposing the observer faults outstanding waiters and stops their timers.
  • Adjust regression tests to validate synchronous zero-timeout completion and dispose behavior.
Show a summary per file
File Description
test/TestInfrastructure/TestExtensions/Diagnostics/RebalancerDiagnosticObserver.cs Adds disposal tracking, synchronous zero-timeout handling, and per-waiter timer lifecycle management/cleanup.
test/Orleans.Core.Tests/Diagnostics/DiagnosticInfrastructureRegressionTests.cs Updates regression assertions for synchronous timeouts and adds coverage for dispose completing outstanding waiters.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

Copilot AI review requested due to automatic review settings July 31, 2026 21:46

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's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

Complete zero-duration waits without a timer callback and fail outstanding waiters when their observer is disposed. Keep timer ownership on the waiter and clean up scheduling failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0c7d7f36-28fd-45f3-aeaf-218a5979a0d7
@ReubenBond
ReubenBond force-pushed the reubenbond-fix-rebalancer-waiter-race branch from e73fc36 to a7b1dc1 Compare July 31, 2026 22:34
Copilot AI review requested due to automatic review settings July 31, 2026 22:34

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's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new

@ReubenBond
ReubenBond merged commit 9f5f1b8 into main Jul 31, 2026
69 of 70 checks passed
@ReubenBond
ReubenBond deleted the reubenbond-fix-rebalancer-waiter-race branch July 31, 2026 22:57
This was referenced Aug 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 31, 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