Repository navigation
Description
Observed failure
UnitTests.Streaming.StreamProvidersTests_ProviderConfigNotLoaded.ServiceId_SiloRestart failed during graceful silo shutdown on Windows/.NET 10 after 30.710 seconds:
System.Threading.Tasks.TaskCanceledException : A task was canceled.
at Orleans.Runtime.Silo.StopAsync(CancellationToken cancellationToken)
in src/Orleans.Runtime/Silo/Silo.cs:line 328
at Orleans.Hosting.SiloHostedService.StopAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StopAsync(CancellationToken cancellationToken)
at Orleans.TestingHost.InProcessSiloHandle.StopSiloAsync(CancellationToken ct)
in src/Orleans.TestingHost/InProcessSiloHandle.cs:line 110
at Orleans.TestingHost.TestCluster.StopSiloAsync(...)
at Orleans.TestingHost.TestCluster.RestartSiloAsync(SiloHandle instance)
in src/Orleans.TestingHost/TestCluster.cs:line 843
at UnitTests.Streaming.StreamProvidersTests_ProviderConfigNotLoaded.ServiceId_SiloRestart()
in test/Orleans.Streaming.Tests/StreamingTests/StreamProvidersTests.cs:line 98
Output reaches Restarting Silos ..., then shutdown exhausts its budget before the service-ID checks can finish.
Evidence and scope
- .NET CI run 35160511003, Windows net10 Functional job 105009940037, observed September 16, 2026.
- PR feat(runtime): add deterministic dissemination broadcast and repair #10236 head:
3fa24157a59f7144985872241d8ac5d064ade6e7; CI tests the PR merge with main. - Artifact:
test_output_test_Functional_windows-latest_net10.0. - Result file:
TestResults/test_results_test_output_test_Functional_windows-latest_net10.0_Orleans.Streaming.Tests_net10.0_x64.trx. - The fixture starts four silos and restarts each active silo. It uses ordinary defaults; dissemination is disabled. This test and
Silo.StopAsyncare unchanged by feat(runtime): add deterministic dissemination broadcast and repair #10236. - The post-rebase run 35161569496 is pending when this issue is filed. The branch includes the recent shutdown fixes fix: drain connection establishment during shutdown #11263, fix: drain admitted client observer invocations during shutdown #11264, and fix(streaming): drain detached pulling-agent work #11268. There is currently no established root cause or standalone reproduction.
Expected behavior
Each silo completes graceful shutdown and restarts within the fixture's existing lifetime budget; every restarted silo reports the configured service ID.
Investigation
Identify the lifecycle observer or shutdown operation still outstanding when the 30-second host budget expires, and reproduce the complete fixture on Windows/.NET 10 before changing timeouts. Preserve the cancellation exception as evidence rather than suppressing it.
Previous issues #4721 and #4997 concern the same test name but describe a five-minute startup membership-activation timeout in older runtime versions. This report tracks the distinct current shutdown cancellation signature.
Activity
ReubenBond commentedon Sep 17, 2026
Investigation result: the 30-second budget is consumed by the silo's
GrainDeactivationlifecycle observer, not by a later connection/observer/stream shutdown stage.The failing artifact from run 35160511003, Windows net10 Functional job 105009940037 shows:
Orleans.Runtime.Silocompletes stageGrainDeactivation (19998)only after00:00:29.9918544, withSome grains failed to deactivate promptlywhen cancellation arrives.GrainDirectoryShutdown, dissemination, and runtime-stage errors begin after cancellation and are fallout.TaskCanceledExceptionfromSilo.StopAsyncthroughHost.StopAsyncandRestartSiloAsync, preserving the shutdown cancellation evidence.The only application activation on that silo is the
Streaming_ConsumerGrainleft byProvidersTests_ConfigNotLoadedin the shared fixture. ItsOnDeactivateAsynclogs immediately and returnsTask.CompletedTask;Grain<TState>also has a no-op lifecycle stop. The remaining deactivation path is therefore the grain-directory unregister beforeActivationData.Deactivatedcan be signaled:Catalog.DeactivateAllActivations->ActivationData.FinishDeactivating->CachedGrainLocator.Unregister->DistributedGrainDirectory.UnregisterAsync/InvokeAsync->DirectoryMembershipService.RefreshViewAsync->ClusterMembershipService.Refresh.TestClusterBuilderconfigures the distributed grain directory, so the legacyDhtGrainLocatorbatch path is not involved. During the stall, the same silo reports that the development membership table version decreased from 10 to 2 and its prior incarnation is no longer authoritative, while traffic continues toward superseded silo incarnations. The distributed-directory operation can then wait for a membership/directory view version which the recreated development table has not reached. Both the activation deactivation timeout and test-host shutdown timeout are 30 seconds, leaving no margin once that view refresh stops converging.The recent shutdown PRs do not establish a fix for this occurrence:
ServiceId_SiloRestart, not a current shutdown root-cause fix.The pending post-rebase run 35161569496 passed this test in 0.646 seconds on Windows/net10 at
ac97ebb69d; three later #10236 Windows/net10 Functional jobs also passed. A targeted run from currentmainpassed 1/1. Since the relevant path is unchanged between the failed and immediate passing PR heads, these passes demonstrate intermittency rather than a causal fix.This signature is tied to #10236's development-membership reset/distributed-directory convergence path. A deterministic regression should hold an unregister across a development-table reset and record the requested, current cluster, and current directory view versions. That gives a bounded place to correct convergence while retaining cancellation evidence. I found no evidence supporting a timeout increase, suppression, or a separate standalone patch, so I am leaving the issue open with this trace rather than opening a workaround PR.
ReubenBond commentedon Sep 18, 2026
Verified fixed by #11294, with the end-to-end gap now covered by post-merge CI.
Root cause: when the development membership table was recreated during the sequential silo restart,
SystemTargetBasedMembershipTableraised a fatal silo error.TestClusterFatalErrorHandlerthen calledhost.StopAsync()with a live token, so the lost process incarnation attempted a graceful drain against unreachable/superseded peers. That drain consumed the 30-second host budget and surfacedTaskCanceledExceptionfromSilo.StopAsyncin this test.#11294 changes the fatal-error path to call
host.StopAsyncwith a pre-canceled token. The silo therefore performs bounded non-graceful lifecycle cleanup instead of waiting for remote drain progress, while cancellation remains classified separately from actual stop failures.Concrete post-merge evidence:
ServiceId_SiloRestartpassed and printed..... Silos restarted.ServiceId_SiloRestart, the logs reproduce the original stimulus on the three remaining silos: membership version decreases10→2,10→4, and10→6, each reported byTestClusterFatalErrorHandler.10→2silo, the fatal notification is logged at22:05:48.289andOrleans Silo stoppedat22:05:48.318. The test passes in 1.063s and prints..... Silos restarted, instead of exhausting the 30-second budget.10→2/4/6fatal rollback signature and a passingServiceId_SiloRestartin 2.405s: run 35283720779, job 105411255555.No additional runtime or test timeout change is needed. Closing as completed by #11294; #11296 supplied the mainline scenario needed to prove the fix end to end.