Merge #1113: gRPC origin already retires a respawned driver's samples (pinned by test); config-change respawn keeps the comms latch trimmed to kept refs; audit warning names the real status; stubbed drivers' value nodes read BadConfigurationError; slow-connect behaviour documented

This commit is contained in:
Joseph Doherty
2026-12-05 03:06:25 -05:00
7 changed files with 499 additions and 20 deletions
+32 -3
View File
@@ -594,9 +594,16 @@ latched Bad, as a Warning naming the driver plus the `otopcua.driver.comms_latch
a push driver missing its initial push, or a value-only dedup swallowing an unchanged value. It is a
tripwire, not a repair: nothing downstream depends on it.
The latch and its audit timer belong to one driver incarnation: `StopChild` (a deploy removal, a disable, the stop half of
a config-change respawn) drops the latch and cancels the pending audit (R-16), so a removed driver never fires a false
Warning / counter increment and a disable then re-enable of the same id never inherits a stale latch. `StopChild` also
The latch and its audit timer belong to one driver incarnation: `StopChild` for a deploy removal or a disable drops the
latch and cancels the pending audit (R-16), so a removed driver never fires a false Warning / counter increment and a
disable then re-enable of the same id never inherits a stale latch. The stop half of a **config-change respawn** keeps it
instead (#1113 — it used to drop it, so a respawn of an already comms-lost driver was never audited, unlike a Restart):
the replacement is what must re-publish those refs. Every apply's reindex trims every outstanding latch to the refs the new
composition still routes for that driver (`TrimCommsLatchesToIndex`) — a ref the deploy dropped is no longer subscribed and
can never be re-published, so it must not be reported — and drops a latch left empty; this runs inside the same apply
message as the respawn, so before the replacement's `Connected` can arm the audit. The Warning names the status the nodes
actually carry: `still BadNoCommunication`, or `still BadWaitingForInitialData` once a respawn / Restart re-stamped them
(#1113). A stub replacement drops the latch (it never connects, so the audit could never arm). `StopChild` also
holds the id in the `ChildHealthLedger` (`Forget` then `Readmit` on the next spawn), so the stopped child's late health
publish cannot resurrect its diagnostics entry.
@@ -642,6 +649,28 @@ supervision restart (same driver object — unchanged, still covered by that chi
disable (`RemovedInputStatus` + node removal). ScadaBridge sees a brief Bad per respawn/Restart — accepted.
Pinned by `DriverHostRespawnValueNodeGapTests` (both seams, both interleavings, no-latch with a positive control).
- **A slow-connecting replacement reads `BadWaitingForInitialData`, not `BadNoCommunication` — accepted (#1113, owner
decision).** The stamp says "a new driver object, no value yet"; it does not change while the replacement's initialise is
still retrying, because the replacement has not lost anything — it has not connected yet. The nodes go
`BadNoCommunication` only if the replacement connects and then loses its device (its own comms-loss stamp, latched and
audited as usual). An operator watching a node stuck at `BadWaitingForInitialData` after a respawn should check the
driver's status on `/hosts` (Connecting / Reconnecting), not the node.
- **A stub replacement reads `BadConfigurationError` (#1113).** When the replacement (or a freshly deployed driver) is a
STUB — no factory for its type on this node, the factory rejected its config, or the type is not allowed on the node's
roles — it never publishes, so `BadWaitingForInitialData` would be a promise that cannot be kept.
`StampStubbedDriverValueNodes` stamps `BadConfigurationError` on the raw + UNS value nodes of every stubbed child after
each apply's `RebuildAddressSpace` Tell (deploy, boot-from-cache, bootstrap restore — on the same host→publish-actor pair,
so the publish actor defers it behind that plan and replays it onto the nodes the apply creates or recreates; re-sent every
apply because a rebuild resets them) and after an operator Restart that respawned a stub. Status-only, not latched.
- **The gRPC data plane's origin side is covered by the producer fence, not by this stamp (#1113).** Projected consumers
(DataConnectionService read / subscribe) do not read the OPC UA node state: they read the `PartitionedSampleHub`, fed
by the driver callback through `SourceSamplePublisher`. `StopChild` / `HandleRestartDriver` call
`RetireCurrentDriver` at the stop, which removes every one of the driver's sources (cached sample released, readiness
`Invalidated`), and spawning the replacement registers a new incarnation (retiring the old fence a second time). Until the
replacement's first value binds a fresh generation there is no current source — a read answers `WaitingForInitialData`,
the old ticket reads not-ready — so the stopped object's last Good is never served there either. Pinned by
`GrpcDataRespawnOriginGapTests` (both seams).
### The connect path feeds the circuit breaker (R2-10 T10 closure)
`IDriver.InitializeAsync` is routed through the capability invoker as