fix: clean up rebalancer diagnostic waiters - #10313
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.Zerowaits 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
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
force-pushed
the
reubenbond-fix-rebalancer-waiter-race
branch
from
July 31, 2026 22:34
e73fc36 to
a7b1dc1
Compare
This was referenced Aug 28, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.