fix(management): purge terminal PendingSecuredWrites rows on the list sweep after a retention window (review 2026-10-21 08/G3)

This commit is contained in:
Joseph Doherty
2026-10-22 09:25:48 -04:00
parent baab6ac78e
commit d495494074
8 changed files with 237 additions and 1 deletions
@@ -11,7 +11,8 @@ namespace ZB.MOM.WW.ScadaBridge.ManagementService;
/// section fails fast at boot with a clear, key-naming message.
/// <para>
/// <see cref="ManagementServiceOptions.SecuredWritePendingTtl"/> is intentionally NOT required positive:
/// a non-positive value legitimately disables server-side secured-write expiry.
/// a non-positive value legitimately disables server-side secured-write expiry. The same holds for
/// <see cref="ManagementServiceOptions.SecuredWriteTerminalRetention"/> (non-positive disables the terminal-row purge).
/// </para>
/// </summary>
public sealed class ManagementServiceOptionsValidator : OptionsValidatorBase<ManagementServiceOptions>
@@ -26,5 +27,9 @@ public sealed class ManagementServiceOptionsValidator : OptionsValidatorBase<Man
builder.RequireThat(options.LongRunningCommandTimeout > FlowDebug.FlowDebugRunner.ResponseGrace,
$"ScadaBridge:ManagementService:LongRunningCommandTimeout must exceed the 5-second response grace " +
$"(was {options.LongRunningCommandTimeout}); it is the Ask timeout for transport/deploy commands.");
builder.RequireThat(options.SecuredWriteTerminalPurgeInterval >= TimeSpan.Zero,
$"ScadaBridge:ManagementService:SecuredWriteTerminalPurgeInterval must not be negative " +
$"(was {options.SecuredWriteTerminalPurgeInterval}); zero purges on every Secured Writes list.");
}
}