fix(historian-gateway): guard canceled antecedent in provisioning continuation

Addresses T15 review: treat a canceled EnsureTags task like a faulted one so the
fire-and-forget continuation never reaches t.Result (which would re-throw and leave
the discarded task unobserved).

Claude-Session: https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii
This commit is contained in:
Joseph Doherty
2026-06-26 18:29:40 -04:00
parent bbfbc7b215
commit 82124ee4f8
@@ -246,10 +246,12 @@ public sealed class AddressSpaceApplier
_ = dispatch.ContinueWith( _ = dispatch.ContinueWith(
t => t =>
{ {
if (t.IsFaulted) if (!t.IsCompletedSuccessfully)
{ {
// Faulted OR canceled — never reach t.Result (which would re-throw and
// leave this discarded continuation unobserved).
_logger.LogWarning(t.Exception?.GetBaseException(), _logger.LogWarning(t.Exception?.GetBaseException(),
"AddressSpaceApplier: historian provisioning of {Count} tag(s) faulted; deploy unaffected", provisionCount); "AddressSpaceApplier: historian provisioning of {Count} tag(s) did not complete; deploy unaffected", provisionCount);
return; return;
} }