feat(galaxy): debug-log native alarm feed delivery (subs + fanout)
v2-ci / build (push) Failing after 38s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped

Native-alarm delivery through OnAlarmFeedTransition was a black box — there was no way
to answer 'is the gateway feed delivering / is a subscription un-gating it', which is
partly why the missing-SubscribeAlarmsAsync wiring shipped undetected. Add a single
per-transition Debug line (kind, ref, live subscription count, fanout flag). Debug so a
flapping galaxy doesn't flood prod, but available on demand.
This commit is contained in:
Joseph Doherty
2026-06-15 01:30:15 -04:00
parent a833d1b4aa
commit dcb0be650e
@@ -1128,6 +1128,7 @@ public sealed class GalaxyDriver
private void OnAlarmFeedTransition(object? sender, GalaxyAlarmTransition transition)
{
GalaxyAlarmSubscriptionHandle? handle;
int subCount;
lock (_alarmHandlersLock)
{
// Pick the earliest-registered handle as the event owner. The server routes
@@ -1137,10 +1138,17 @@ public sealed class GalaxyDriver
// subscription remains — HashSet.First() was unstable across mutations
// (Driver.Galaxy-006 fix). _alarmSubscriptions is a List, so [0] is always
// the earliest-registered handle.
handle = _alarmSubscriptions.Count > 0
? _alarmSubscriptions[0]
: null;
subCount = _alarmSubscriptions.Count;
handle = subCount > 0 ? _alarmSubscriptions[0] : null;
}
// Native-alarm delivery observability (was a black box): one line per feed transition with the
// resolved alarm ref, the live subscription count, and whether it fans out to OnAlarmEvent. Debug
// so a flapping galaxy doesn't flood prod, but available on demand to answer "is the feed
// delivering / is the subscription un-gating it" — the exact question this driver couldn't answer
// before the SubscribeAlarmsAsync wiring fix.
_logger.LogDebug(
"GalaxyDriver alarm feed: {Kind} {Ref} (subs={Subs}, fanout={Fanout})",
transition.TransitionKind, transition.AlarmFullReference, subCount, handle is not null);
if (handle is null) return;
var args = new AlarmEventArgs(