fix(runtime): #1113 a config-change respawn keeps the comms latch, trimmed to the refs the new composition still routes

Item 2. StopChild cleared the comms-loss latch unconditionally, so a
config-change respawn of an already comms-lost driver never audited its
replacement (an operator Restart does, #1053). StopChild(respawning: true) now
keeps it; every apply's reindex trims every outstanding latch to the refs still
routed for that driver (TrimCommsLatchesToIndex) and drops an emptied one, so a
ref the deploy dropped (no longer subscribed, cannot be re-published) never
raises a false audit Warning. Both run inside the same apply message, before the
replacement's Connected can arm the audit.

Tests: DriverHostRespawnValueNodeGapTests — kept latch audits the silent
replacement for exactly the kept ref (fails if the latch is cleared or not
trimmed), and a replacement re-publishing every kept ref stays silent (fails
without the trim).
This commit is contained in:
Joseph Doherty
2026-12-05 03:03:43 -05:00
parent 5ef8089e1f
commit 77adf410df
3 changed files with 145 additions and 12 deletions
+8 -3
View File
@@ -594,9 +594,14 @@ 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. `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.