Merge driver follow-ups A: Modbus RTU response correlation + cancel redial + rebuild e2e (#1029/#1055), MTConnect malformed-item BadDecodingError + cross-chunk condition severity (#1055/#1037), TwinCAT write fail-fast + retired-client reads (#1035), OpcUaClient skipped-tag ledger append + zone-qualified IPv6 probe (#1039)

This commit is contained in:
Joseph Doherty
2026-12-03 15:25:42 -05:00
28 changed files with 1137 additions and 38 deletions
+8
View File
@@ -840,6 +840,14 @@ NodeIds moved together in every leg. Fixture containers were restored healthy af
baseline, where several states are simultaneously active, and only to CONDITION observations. A `/sample` chunk is a
time-ordered delta, so it is last-wins: Fault then Normal reads Normal, Fault then UNAVAILABLE reads
`BadNoCommunication`. (The native-alarm path never had the problem — `MTConnectConditionTracker`.)
**Follow-up (#1037/#1055):** the value word is now DERIVED from the tracker (`MTConnectObservationIndex.Apply(..., conditions)`;
the driver folds the tracker first), so it is the most severe still-active `nativeCode` across chunks: Fault(A) then
Warning(B) — in one chunk or two — reads Fault, and clearing A leaves B's Warning. A document with no tracker (the
index's own unit tests) keeps the per-document reconcile above.
- **Malformed observation, per item (#1055).** An observation skipped for a missing/unparseable `timestamp` still names its
`dataItemId`; the result carries it in `MalformedDataItemIds` and the index marks that item `BadDecodingError` (published to
its subscribers) until a valid observation replaces it — the last Good value no longer stands forever. One with no
`dataItemId` cannot be attributed and is only counted.
- **M-5 — subscription leak.** `ShutdownAsync` releases every data and alarm subscription. The host actor abandons its
handles on each reconnect/Force Reconnect and re-subscribes after the next init, so the old registrations used to pile up
(one per cycle: an extra callback per observation and a pump that never stopped). `InitializeAsync` deliberately does
+4 -2
View File
@@ -436,8 +436,10 @@ initialise (the AdminUI form drops them on the next save). Pinned by
> resolve to an upstream node id (`BadNodeIdInvalid`, no wire call) or the server refused the create (`BadNodeIdUnknown`,
> `BadAttributeIdInvalid`, … — `CreateItemsAsync` reports these on the item's status, it does not throw) — is published
> **Bad once with that code** and counted in ONE summarised Warning (G-12); it used to sit silently at the host's last
> stamp, `BadNoCommunication`, pointing at comms rather than the address. (It is not added to the skipped-tag report, which
> is an init-time snapshot.) The recovery / reconcile re-publish finds a ref's subscriptions through a per-subscription ref
> stamp, `BadNoCommunication`, pointing at comms rather than the address. (#1039: it is also appended to the skipped-tag
> report through `SkippedTagLedger.Append` — once per path however often the subscribe is retried, withdrawn by a later
> subscribe that gets the item, and cleared by the next re-initialise's rebuild, which re-appends what is still refused.
> The TCP preflight of Test Connect dials `Uri.IdnHost`, so a zone-qualified IPv6 endpoint keeps its zone.) The recovery / reconcile re-publish finds a ref's subscriptions through a per-subscription ref
> set, not a scan of every monitored item under the delivery lock (G-10: 20k refs went from ~6 s to ~1 s). `UnsubscribeAsync` /
> `UnsubscribeAlarmsAsync` leave the subscription tracked until they hold the subscription gate; if the wait is **cancelled**
> (the host's 5 s unsubscribe token vs a slow `ConditionRefresh`), the handlers are detached synchronously — nothing more is
+8
View File
@@ -337,6 +337,14 @@ client, and its 2 s used to silently override a raised driver `Timeout` for ever
and the rest of that device's tags fail fast with no wire attempt, an answer and the failure was that one
tag's. A device the probe already counts unreachable (3 failed ticks) fails fast outright. A native subscribe
applies the same rule. Health is applied once per device per call (P-19), still Degraded on a comms failure.
**Writes get the same per-call verdict (#1035):** the first comms-class write failure is state-checked once per
device, and a gone (or never-connected / probe-unreachable) device's remaining writes answer `BadCommunicationError`
with no wire attempt — a 10-write batch used to pay the timeout ten times. And a read already in flight when the
client is retired (symbol-table invalidation / reconnect) is discarded and re-read once on a fresh client rather than
published from the retired symbol cache (a sum-read chunk falls back to single reads). A retirement landing after
the read returned is still the P-1 window; writes cannot be un-sent and are not re-run. Hardware gate: stop the PLC
runtime/route mid-batch on a real device and confirm the batch returns in ~one timeout, and an online change during a
slow read never publishes a pre-change value.
- **The probe does not replay against an offline PLC (P-4).** The probe connects without replaying the stored
registrations, probes, and re-registers them only after the device answered; a replay that hits a dead device
stops dialling it. While the device is down the registrations publish `BadCommunicationError` once and one