From 47f0b98c6e0eeb663ee14d4e6fa063623c74408d Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 13 Nov 2026 06:55:27 -0500 Subject: [PATCH] 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 stays: it also covers the mesh telemetry/command streams. GracefulStopWithOpenSyncStreamTests' positive control started passing the stop in ~950 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. Release build 0 warnings. Host.Tests 288/288, Host.IntegrationTests 350 passed / 2 skipped, Runtime.Tests 1063 passed / 3 skipped, Core.AlarmHistorian.Tests 53/53. Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi --- Directory.Packages.props | 4 ++-- .../GracefulStopWithOpenSyncStreamTests.cs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d84109317..eafd04611 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -227,8 +227,8 @@ package floors the native SQLitePCLRaw.lib.e_sqlite3 at 2.1.12, so consumers inherit the CVE-2025-6965-fixed native binary without needing the surgical pin below. --> - - + + diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/LocalDb/GracefulStopWithOpenSyncStreamTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/LocalDb/GracefulStopWithOpenSyncStreamTests.cs index d620b0658..3fe3b929a 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/LocalDb/GracefulStopWithOpenSyncStreamTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/LocalDb/GracefulStopWithOpenSyncStreamTests.cs @@ -12,7 +12,10 @@ using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Shouldly; using Xunit; using ZB.MOM.WW.LocalDb; @@ -168,6 +171,20 @@ public sealed class GracefulStopWithOpenSyncStreamTests }); builder.Services.AddSingleton(db); 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 #906 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(), + sp.GetRequiredService>(), + sp.GetRequiredService(), + sp.GetService(), + sp.GetService(), + lifetime: null))); + } builder.Services.AddAkka("otopcua906", (ab, _) => ab.AddHocon( ConfigurationFactory.ParseString(