chore(deps): pin ZB.MOM.WW.LocalDb 0.3.8 (scadaproj#57)
LocalDb 0.3.8 ends open sync streams on ApplicationStopping and refuses new ones Unavailable while stopping (lmxopcua#906, library side). The host-side ShutdownStreamCancellationInterceptor (#140) stays. GracefulStopWithOpenSyncStreamTests' positive control passed the stop in ~900 ms under 0.3.8, because the library alone now ends the stream. The control registers LocalDbSyncService without the host lifetime (the 0.3.7 behaviour), so it still reproduces the 8 s drain; verified it fails on 0.3.8 without that change. Release build 0 warnings. Host.Tests 733/733, IntegrationTests 133/133 (incl. the LocalDb site-pair convergence tests), Communication.Tests 843/843, HealthMonitoring.Tests 131/131, SiteEventLogging.Tests 118/118. Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
@@ -123,9 +123,9 @@
|
|||||||
<PackageVersion Include="ZB.MOM.WW.Secrets.Abstractions" Version="0.6.2" />
|
<PackageVersion Include="ZB.MOM.WW.Secrets.Abstractions" Version="0.6.2" />
|
||||||
<PackageVersion Include="ZB.MOM.WW.Secrets.Ui" Version="0.6.2" />
|
<PackageVersion Include="ZB.MOM.WW.Secrets.Ui" Version="0.6.2" />
|
||||||
<PackageVersion Include="ZB.MOM.WW.Secrets.Replicator.SqlServer" Version="0.6.2" />
|
<PackageVersion Include="ZB.MOM.WW.Secrets.Replicator.SqlServer" Version="0.6.2" />
|
||||||
<PackageVersion Include="ZB.MOM.WW.LocalDb" Version="0.3.7" />
|
<PackageVersion Include="ZB.MOM.WW.LocalDb" Version="0.3.8" />
|
||||||
<PackageVersion Include="ZB.MOM.WW.LocalDb.Replication" Version="0.3.7" />
|
<PackageVersion Include="ZB.MOM.WW.LocalDb.Replication" Version="0.3.8" />
|
||||||
<PackageVersion Include="ZB.MOM.WW.LocalDb.Contracts" Version="0.3.7" />
|
<PackageVersion Include="ZB.MOM.WW.LocalDb.Contracts" Version="0.3.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
+17
-1
@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Http.Features;
|
|||||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
@@ -46,7 +47,8 @@ namespace ZB.MOM.WW.ScadaBridge.IntegrationTests;
|
|||||||
/// <para>
|
/// <para>
|
||||||
/// The second test is the positive control: the same stack as it was before the fix — the Akka service
|
/// The second test is the positive control: the same stack as it was before the fix — the Akka service
|
||||||
/// seen by the host as a plain <see cref="IHostedService"/> (so its shutdown runs only in
|
/// seen by the host as a plain <see cref="IHostedService"/> (so its shutdown runs only in
|
||||||
/// <c>StopAsync</c>) and no stream interceptor — reproduces the bug: the stop waits out the whole
|
/// <c>StopAsync</c>), no stream interceptor, and the LocalDb sync service built without the host
|
||||||
|
/// lifetime (LocalDb 0.3.8 would otherwise end the stream itself) — reproduces the bug: the stop waits out the whole
|
||||||
/// shutdown timeout and the cluster is left only after the drain. Without it, a fast stop in the first
|
/// shutdown timeout and the cluster is left only after the drain. Without it, a fast stop in the first
|
||||||
/// test could be a harness that never held a stream open at all.
|
/// test could be a harness that never held a stream open at all.
|
||||||
/// </para>
|
/// </para>
|
||||||
@@ -197,6 +199,20 @@ public sealed class GracefulStopWithOpenSyncStreamTests
|
|||||||
});
|
});
|
||||||
builder.Services.AddSingleton(db);
|
builder.Services.AddSingleton(db);
|
||||||
builder.Services.AddZbLocalDbReplication(ReplicationConfig(peerAddress: null));
|
builder.Services.AddZbLocalDbReplication(ReplicationConfig(peerAddress: null));
|
||||||
|
if (!withFix)
|
||||||
|
{
|
||||||
|
// From LocalDb 0.3.8 the library itself ends open sync streams on ApplicationStopping
|
||||||
|
// (scadaproj#57), which would hide the drain in this control. Re-register the service
|
||||||
|
// WITHOUT the host lifetime, i.e. the 0.3.7 behaviour, so the control still reproduces
|
||||||
|
// the bug the host-side fix guards against.
|
||||||
|
builder.Services.Replace(ServiceDescriptor.Singleton(sp => new LocalDbSyncService(
|
||||||
|
sp.GetRequiredService<ILocalDb>(),
|
||||||
|
sp.GetRequiredService<IOptions<ReplicationOptions>>(),
|
||||||
|
sp.GetRequiredService<ILoggerFactory>(),
|
||||||
|
sp.GetService<LocalDbMetrics>(),
|
||||||
|
sp.GetService<ISyncStatus>(),
|
||||||
|
lifetime: null)));
|
||||||
|
}
|
||||||
|
|
||||||
// The production AkkaHostedService, registered the way Program/SiteServiceRegistration do.
|
// The production AkkaHostedService, registered the way Program/SiteServiceRegistration do.
|
||||||
// Role "StopProbe" (neither Central nor Site) makes StartAsync register only the dead-letter
|
// Role "StopProbe" (neither Central nor Site) makes StartAsync register only the dead-letter
|
||||||
|
|||||||
Reference in New Issue
Block a user