fix: only active singleton node sends health reports

Both nodes of a site cluster were sending health reports. The standby
node (without the DeploymentManager singleton) reported 0 instances and
no connections, overwriting the active node's data in the aggregator.

Added IsActiveNode flag to ISiteHealthCollector, set by
DeploymentManagerActor on PreStart/PostStop. HealthReportSender skips
sending when the node is not active. Also ensured EnsureDclConnections
is called during startup batch creation so data connections survive
container restarts.
This commit is contained in:
Joseph Doherty
2026-03-18 01:44:57 -04:00
parent 213ca2698a
commit 8095c8efbe
6 changed files with 40 additions and 3 deletions

View File

@@ -83,6 +83,7 @@ public class DeploymentManagerActor : ReceiveActor, IWithTimers
protected override void PreStart()
{
base.PreStart();
_healthCollector?.SetActiveNode(true);
_logger.LogInformation("DeploymentManagerActor starting — loading deployed configs from SQLite...");
// Load all configs asynchronously and pipe to self
@@ -94,6 +95,12 @@ public class DeploymentManagerActor : ReceiveActor, IWithTimers
}).PipeTo(Self);
}
protected override void PostStop()
{
_healthCollector?.SetActiveNode(false);
base.PostStop();
}
/// <summary>
/// OneForOneStrategy: Resume on exceptions to preserve Instance Actor state,
/// Stop only on ActorInitializationException (actor failed to start).
@@ -160,6 +167,7 @@ public class DeploymentManagerActor : ReceiveActor, IWithTimers
for (var i = startIdx; i < endIdx; i++)
{
var config = state.Configs[i];
EnsureDclConnections(config.ConfigJson);
CreateInstanceActor(config.InstanceUniqueName, config.ConfigJson);
}