Files
scadaproj/ZB.MOM.WW.LocalDb/src
Joseph Doherty 3ddb083b4c fix(localdb): end open sync streams on ApplicationStopping (lmxopcua#906)
LocalDbSyncService observed only the call token, which ASP.NET Core cancels
at the END of Kestrel's graceful drain. A peer's sync stream never ends on
its own, so every graceful stop of the passive node waited out the host's
whole ShutdownTimeout (30 s on OtOpcUa QA).

The service now takes an optional IHostApplicationLifetime (DI supplies it
in any generic host): ApplicationStopping is linked into the stream's token
and ends the session cleanly, and a stream arriving once stopping has begun
is refused Unavailable. Wire-compatible; no proto/schema change.

Tests: open stream ends within 5 s of StopApplication, new stream refused
Unavailable, control without a lifetime still running; both halves
mutation-killed. 262/262. Source only, NOT published (still 0.3.7).

Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
2026-11-13 03:29:31 -05:00
..