chore(runtime): warn on missing VirtualTag evaluator; document Stale-recovery VirtualTag behaviour

Log a WARNING on startup when IVirtualTagEvaluator is not registered so a DI misconfig on a
driver-role node is visible in logs instead of silently evaluating all VirtualTags to NoChange.
Add a comment in PushDesiredSubscriptions noting that TryRecoverFromStale does not call this
method, so VirtualTags remain empty after a Stale recovery until the next deployment dispatch
(intentional, consistent with driver recovery).
This commit is contained in:
Joseph Doherty
2026-06-07 05:46:24 -04:00
parent 397f9b783a
commit 2bfe18abcf
2 changed files with 12 additions and 1 deletions
@@ -93,7 +93,13 @@ public static class ServiceCollectionExtensions
// Production evaluator is the Host's RoslynVirtualTagEvaluator (registered as
// IVirtualTagEvaluator); fall back to the null evaluator for test harnesses that don't
// register one (VirtualTagActor children then evaluate to nothing).
var virtualTagEvaluator = resolver.GetService<IVirtualTagEvaluator>() ?? NullVirtualTagEvaluator.Instance;
var virtualTagEvaluator = resolver.GetService<IVirtualTagEvaluator>();
if (virtualTagEvaluator is null)
{
loggerFactory.CreateLogger("ZB.MOM.WW.OtOpcUa.Runtime.ServiceCollectionExtensions")
.LogWarning("IVirtualTagEvaluator not registered; Equipment VirtualTags will evaluate to NoChange (no live values). Expected only in test harnesses — driver-role nodes should register RoslynVirtualTagEvaluator.");
virtualTagEvaluator = NullVirtualTagEvaluator.Instance;
}
var dbHealth = system.ActorOf(
DbHealthProbeActor.Props(dbFactory),