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 — test: observe grain directory convergence in liveness tests by ReubenBond · Pull Request #10299 · dotnet/orleans Conversation
|
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR improves the reliability of Orleans liveness/membership tests by retrying post-recovery grain calls which can transiently time out after a hard silo kill (where failure detection and directory convergence are timing-sensitive under CI load).
Changes:
Do_Liveness_OracleTest_2 with a retry-on-timeout helper.SendTrafficWithRetry to tolerate transient TimeoutExceptions for a bounded period after kill/restart.System.Diagnostics usage for retry window timing.| File | Description |
|---|---|
| test/Orleans.Runtime.Tests/MembershipTests/LivenessTests.cs | Adds bounded retry logic around post-recovery grain calls to reduce spurious liveness test failures under load. |
test/Orleans.Runtime.Tests/MembershipTests/LivenessTests.cs:186
SendTrafficWithRetry should accept the caller's Stopwatch/window instead of starting a new one per call. This prevents multiplying the retry budget by the number of grains. private async Task SendTrafficWithRetry(long key, bool startTimers = false)
{
var stopwatch = Stopwatch.StartNew();
var retryWindow = TimeSpan.FromSeconds(60);
while (true)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Wait for LocalGrainDirectory to apply the membership version observed by each active silo before liveness stabilization completes. The version signal is published after stale directory and cache entries are removed, closing the race between silo-status convergence and grain routing without polling, sleeps, or call retries. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 965b2b7b-61b4-474d-ac47-bec64d97ff6c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.TestingHost/LivenessStabilizationHelper.cs:56
timeout for ISiloStatusOracle convergence and then wait up to another full timeout for grain-directory cleanup, so this method can exceed its timeout parameter. If timeout is intended as an overall bound (as implied by callers), consider using the remaining time budget for the grain-directory phase. waitTasks = testHooks.Select(hooks => hooks.WaitForGrainDirectoryMembershipVersion(timeout));
results = await Task.WhenAll(waitTasks).WaitAsync(timeout);
return results.All(static result => result);
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.
There was an error while loading. Please reload this page.
Emit membership-version-applied diagnostics after local directory cleanup and after distributed partition transitions complete. Test hooks subscribe to the aggregate directory event using a check-subscribe-check pattern instead of calling a waiter on LocalGrainDirectory. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 965b2b7b-61b4-474d-ac47-bec64d97ff6c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.TestingHost/LivenessStabilizationHelper.cs:29
WaitForLivenessToStabilizeAsync logs that it is waiting "up to" the provided timeout, but this helper no longer tracks elapsed time. Since subsequent waits use the full timeout again, the overall stabilization wait can exceed the caller-provided budget, slowing/derailing tests. public static async Task<bool> WaitForExpectedActiveSilosAndGatewaysAsync(
IReadOnlyCollection<SiloHandle> activeSilos,
IReadOnlyCollection<ITestHooks> testHooks,
GatewayManager gatewayManager,
TimeSpan timeout)
{
ArgumentNullException.ThrowIfNull(gatewayManager);
if (!await WaitForExpectedActiveSilosAsync(activeSilos, testHooks, timeout))
{
return false;
}
return await WaitForExpectedActiveGatewaysAsync(activeSilos, gatewayManager, timeout);
}
src/Orleans.TestingHost/LivenessStabilizationHelper.cs:56
timeout, so it can take up to ~2× the intended stabilization budget. Consider accounting for elapsed time before starting the second phase so the method honors the provided overall timeout. try
{
var waitTasks = testHooks.Select(hooks => hooks.WaitForActiveSilos(expectedActiveSilos, timeout));
var results = await Task.WhenAll(waitTasks).WaitAsync(timeout);
if (!results.All(static result => result))
{
return false;
}
waitTasks = testHooks.Select(hooks => hooks.WaitForGrainDirectoryMembershipVersion(timeout));
results = await Task.WhenAll(waitTasks).WaitAsync(timeout);
return results.All(static result => result);
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.
Keep grain directory runtime behavior unchanged and emit only local-applied and partition-observed diagnostics. In-process test clusters subscribe before silo startup and track membership versions plus existing range-operation lifetimes externally, allowing liveness stabilization to await directory convergence without runtime task tracking or state. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 965b2b7b-61b4-474d-ac47-bec64d97ff6c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.TestingHost/LivenessStabilizationHelper.cs:33
timeout is reused for the silo-status wait, grain-directory convergence wait, and gateway convergence wait, so the overall stabilization can exceed the intended timeout. Track elapsed time and pass the remaining time to each subsequent stage. if (waitForGrainDirectoryConvergence is not null
&& !await waitForGrainDirectoryConvergence(timeout))
{
return false;
}
src/Orleans.TestingHost/LivenessStabilizationHelper.cs:49
activeSilos.Count == 0, this helper returns immediately without waiting, even though callers/logging treat it as a stabilization wait. This was previously a delay for the full timeout; consider keeping that behavior to avoid surprising fast-fail paths. if (activeSilos.Count == 0)
{
return false;
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Use a single timeout budget across silo-status, grain-directory, and gateway convergence, and preserve the existing fallback delay when no active silos are available. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 965b2b7b-61b4-474d-ac47-bec64d97ff6c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Do not await runtime grain-directory diagnostics when InProcessTestCluster uses its custom InProcessGrainDirectory, which does not emit those events. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 965b2b7b-61b4-474d-ac47-bec64d97ff6c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Only enable directory convergence observation when each silo uses the built-in local or distributed directory. External default directory implementations do not emit the required diagnostics, so retain the existing liveness stabilization path for those clusters. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 965b2b7b-61b4-474d-ac47-bec64d97ff6c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.