Commit Graph

1260 Commits

Author SHA1 Message Date
Joseph Doherty 568d466303 Merge driver review fixes: MQTT deterministic host claim + re-assert (#988), Galaxy secured-write refusal + re-advise session guard (#991), Heidenhain host-status/dispose (#990), MicroLogix L files (#984), Modbus DI<n> (#981), AbCip latch + probe init bound (#983) 2026-12-03 12:09:42 -05:00
Joseph Doherty eb78875c24 fix(galaxy): #991 review — a re-advise pass never dials on a swapped session; dropped-event resync is rate-limited and coalesced
- ReadviseSubscriptionAsync: a reconnect completing between two subscriptions of a pass
  (dropped-event resync loop had no per-iteration check) sent the next SubscribeBulk to the
  NEW gateway session under the OLD session number; TryRebind refused it (SessionChanged)
  and the live new-session advises were never bound or released, then duplicated by the
  replay. The pass now refuses to dial once its session moved. Releasing afterwards was
  rejected: once the session moved, which session issued the reply's handles is ambiguous and
  old numbers are reused (#861); not dialling is the unambiguous fix.
- Dropped-event resync passes are at least 5 s apart (DropResyncMinInterval); drops reported
  meanwhile coalesce into the next pass, so repeated overflow bursts no longer churn
  re-advises into the overflowing channel.
- Test seams: ResyncDroppedHandlesForTestsAsync, NotifyEventsDroppedForTests,
  DropResyncMinIntervalForTests; AdvisingSubscriber gained after-subscribe/unsubscribe hooks.
2026-12-03 12:07:28 -05:00
Joseph Doherty 5dcb766fd1 fix(abcip): #983 review — probe timeout bounds only the probe read, not the cold initialisation
P-22 moved the probe's own short timeout (default 2 s) onto the probe runtime's cold
InitializeAsync too — on the native transport the TCP connect + RegisterSession + Forward
Open, which the pooled connection bounds with the driver's Timeout. A slow-but-healthy open
longer than the probe timeout never completed: the probe re-created and timed out every
tick and the host stayed Stopped. Initialisation now runs under the loop token only; the
probe timeout bounds the read.
2026-12-03 12:03:49 -05:00
Joseph Doherty 84a0226bfa fix(abcip): #983 review — per-call device latch only on real connection failures; never evict handles that were not attempted
- On libplctag each tag is its own request with its own timeout: one tag's Timeout latched
  the whole device for the call, failing (and evicting) every later sibling. The latch now
  fires on BadConnection/Abort/socket-IO failures always, and on Timeout only on the native
  transport, where a reply timeout faults the device's one shared channel
  (AbCipRefusals.LatchesDevice).
- Items latched out were never attempted: their handles are kept (evicting re-created, and
  for a sole lease holder re-Forward-Opened, each one next poll). The failed item's handle is
  still evicted, and a throttled cold create now latches the device so kept warm handles
  fail fast instead of each paying a timeout.
- AbCipDeadDeviceBatchTests recovery leg: the device's kept warm handles answer again.
2026-12-03 12:03:14 -05:00
Joseph Doherty 1c7e06502f fix(historian): #976 review — Gateway alarm writer isolates an unrecognised batch failure per event
#976 made StatusCode.Unknown (the gateway's handler threw) and non-RPC non-transport exceptions
RetryPlease. On the SendEvents path a RetryPlease marked the whole chunk and every later chunk
RetryPlease; with no Ack the sink treats the drain as an outage and counts nothing, so ONE such
event at the queue head stalled all Gateway alarm history until the 1,000,000-row capacity evicted
it silently. The SQL writers already isolate unrecognised failures (AlarmBatchWrite); the Gateway
writer had no equivalent.

Gateway: a RetryPlease failure that is not a known outage (IsSystemicFailure: Unavailable,
DeadlineExceeded, Cancelled, ResourceExhausted, Aborted, auth codes, typed Unavailable/auth client
exceptions, or a socket/IO/HTTP/disposed/timeout/cancellation cause) re-sends the chunk singly at
once: siblings Ack, the culprit keeps RetryPlease and dead-letters via MaxAttempts. If no single
Acks it is treated as systemic (later chunks not sent) — bounded to one chunk of singles per drain.

SQL (LOW): AlarmBatchWrite stops isolating at the first single that fails with a known outage
error; the SQL Server alarm writer passes the wider SqlHistorianConnection.IsOutage (login failed
18456/18452, unreachable/refused 2/40/53/64/121/10061/10065/-1, severity >= 20, pool timeout) —
IsTransient is unchanged for its retry callers. Fixes the false claim in docs/AlarmHistorian.md.

Tests: GatewayAlarmPoisonDrainTests (real LocalDb sink + real writer: poison at the queue head ⇒
siblings Ack on the first drain, poison dead-letters via MaxAttempts; positive control: Unavailable
outage ⇒ no single sends, nothing dead-lettered), writer-level isolation + bounded fan-out tests,
AlarmBatchWrite early-stop + no-stop-on-adjacent-poison control, SqlOutageClassificationTests.
2026-12-03 12:01:24 -05:00
Joseph Doherty 7374fdd0e4 fix(modbus): #981 review — MELSEC no longer claims the generic DI<n> discrete-input mnemonic
The S-8 gate (no generic mnemonic fallback once a family grammar claimed the address) made
the MELSEC D-register grammar, which claimed every D prefix, reject DI100 as a malformed
D-register. MELSEC has no DI device, so DI... is no longer claimed; every other D... stays
native and DL205's non-octal C rejection is untouched.
2026-12-03 11:58:15 -05:00
Joseph Doherty b74b5162d2 fix(ablegacy): #984 review — MicroLogix profile supports L files
MicroLogix 1100/1200/1400/1500 all have L (32-bit integer) files (only the ML 1000 lacks
them, and the family flag cannot tell it apart — an ML 1000 refuses an L read itself, per
tag). SupportsLongFile: false made the P-5 per-tag rule refuse every Long tag on the family
the parser, coalescer and L-bit RMW already handle. The per-tag rejection tests now pin
PLC-5, the one family without L files. Pending hardware confirmation: one L-tag read on an
ML 1400 (Vitamine press fleet).
2026-12-03 11:57:09 -05:00
Joseph Doherty 2d28f5ea8a fix(heidenhain): #990 review — host-facing state keyed by host:port survives re-init; dispose cancels before closing the session
- _facing was keyed by runtime instance: it grew one entry per re-init (watchdog every ~90 s
  while a control is down) and each new runtime restarted at Unknown, so a down control's
  status flapped Stopped -> Unknown -> Stopped across every re-init. Now keyed by host:port,
  pruned to the configured hosts at init and cleared at shutdown; a runtime no longer in
  _devices (being stopped by re-init/shutdown) announces nothing.
- DeviceRuntime.DisposeAsync cancels the loop BEFORE closing the session: closing first woke
  an in-flight read while the token was live, and the loop's normal tail set Backoff (host
  Stopped) for a plain stop. Seam AfterSessionCloseForTests makes the race deterministic.
2026-12-03 11:55:28 -05:00
Joseph Doherty 7a6e623485 fix(galaxy): #991 review — refuse SecuredWrite/VerifiedWrite locally with BadUserAccessDenied; gateway caller refusals are access refusals
G-1 routed secured/verified writes to WriteSecured, which cannot succeed (no AuthenticateUser
identity, no supervisory advise for it, the key needs invoke:secure), and the gateway's
refusal surfaced as BadCommunicationError.

- WriteOneAsync refuses SecuredWrite/VerifiedWrite BadUserAccessDenied before AddItem/advise/
  Write (one Warning per attribute, no health impact). InvokeWriteSecuredAsync removed until a
  real per-caller identity flow exists.
- gRPC PermissionDenied/Unauthenticated on the write or its supervisory advise ->
  BadUserAccessDenied (handle still forgotten; not counted as advise_failed).
- The classification seed is KEPT: it is what makes the refusal local. Unseeded, a secured
  attribute takes the supervisory raw path and the refusal would rest on MXAccess answering
  MX_E_SecuredWrite (1012) to a supervisory write, a code no live capture has shown.
- docs/drivers/Galaxy.md + Configuration.md updated.
2026-12-03 11:52:22 -05:00
Joseph Doherty f7a0dad7e3 fix(mqtt): #988 review — deterministic primary-host claim id per (hostId, group) + re-assert over a foreign OFFLINE
The M-3 fix made the blank-clientId claim id random per instance, breaking single-claim
exclusivity on a redundant pair: a Secondary cold-starting before its cluster join claimed
alongside the Primary, and its stand-down OFFLINE was left retained, newer than the
Primary's ONLINE, with nothing to correct it.

- Claim id = spbhost-<12 hex of SHA-256(hostId, groupId)>: a pair shares one id (broker
  takeover keeps the claim single; the evicted Primary reconnects and re-asserts), distinct
  groups/hosts differ; 20 chars.
- The claim subscribes to its own STATE topic. An OFFLINE seen while the claim is held (its
  own stand-down detaches first, so the echo is ignored) is re-asserted: ts <= session ts ->
  republish the session's ONLINE; newer ts -> fresh claim whose timestamp out-dates it
  (Sparkplug 3.0 edges ignore older STATE). Coalesced, <= 1 per 2 s. Reconnect re-subscribes
  before republishing so the takeover's leftover is seen.
- MiniBroker can inject a PUBLISH and records SUBSCRIBE filters; live pair test against the
  Mosquitto fixture.
2026-12-03 11:49:06 -05:00
Joseph Doherty 2827a4c3bf fix(calculation): #995 change-triggered evaluations coalesce latest-wins per calc tag, so a poll cycle evaluates once against all its new inputs and the queue is bounded by the tag count
At most one evaluation is pending per calc tag; a re-trigger only moves its
timestamp forward and the dependency snapshot is taken when the pump dequeues
it. Previously every dependency arrival enqueued a separate evaluation per
dependent with a trigger-time snapshot: k inputs of one cycle ran k times
(publishing intermediates computed from mixed old/new inputs) and the queue had
no bound when triggers outpaced the pump. The out-of-process batch pump now
dequeues every pending tag once per batch.
2026-12-03 11:05:32 -05:00
Joseph Doherty 8e57311f97 Merge #993: Gateway read refusals keep historian healthy, QuestDB capped reverse events read finds its cut first, allocation-free time-weighted aggregate, QuestDB fixture visibility wait 2026-12-03 10:40:49 -05:00
Joseph Doherty aecd2461c1 Merge #991: Galaxy secured-write map filled at init, dropped pump events resync, deploy-watch backoff, replay-gap handle release, HTTP/2 keep-alive on driver channels 2026-12-03 10:36:36 -05:00
Joseph Doherty b9955f6946 Merge #988: MQTT bad filter isolated per tag, Sparkplug primary-host unique id + re-claim, rebirth counter fixed, subscribe replay race, browse honours refusals 2026-12-03 10:35:43 -05:00
Joseph Doherty 028e68edb0 fix(mqtt): #988 one bad filter/tag no longer takes the driver dark; Sparkplug rebirth cap, primary-host claim and browse verdicts behave correctly
- M-2: malformed topic filters are rejected at the reader + deploy gate (MqttTopicFilterRules);
  the manager re-checks, chunks SUBSCRIBEs at 100 filters and bisects content refusals only.
- Found while pinning M-2: retain handling rides only a 5.0 SUBSCRIBE; on 3.1.1 one
  retainSeed:false tag made MQTTnet refuse the whole batch.
- M-1: metadata rebirths capped per scope, counted when sent, re-armed only by clean data
  (not by the NBIRTH a request provokes); gap rebirths escalate to 5 min after 3 in a row.
- M-3: blank clientId => random per-instance spbhost-<12 hex> claim id (was literal -spbhost).
- M-6: a Faulted/Disposed claim connection is not held; it is disposed and re-claimed.
- M-9: subscribe-time replay re-raises a value pushed mid-replay (plain + Sparkplug).
- M-11: same-type Sparkplug arrays are served by copy, not boxed element by element.
- M-12: span JSONPath walk; span pre-filter for unauthored Sparkplug nodes; guarded Debug
  logs; WarnOnce without ConcurrentDictionary.Count.
- M-13: handles a later subscribe fully took over are retired.
- M-14: browse open fails on a refused CONNACK or root SUBACK.
- M-15: Scalar/Raw booleans publish true/false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 10:35:21 -05:00
Joseph Doherty afaf6b97d5 fix(galaxy): #991 G-19 gateway channels send HTTP/2 keep-alive pings so a silently dead connection faults the event stream 2026-12-03 10:34:51 -05:00
Joseph Doherty c6dec9ed7f Merge #974 + #987: dialect-aware Sql read-only guard + read-only execution (13 bypasses closed), provider-semantics key matching, trigger-safe SQL Server rowcount 2026-12-03 10:34:08 -05:00
Joseph Doherty 65c4330a68 fix(sql): #974 #987 named queries are lexed per dialect and run read-only + single-statement; key rows attribute by server semantics; SQL Server writes count only the target statement
#974 (S-7) — the named-query guard had one lexer for five dialects and took live SQL for literal text
where a provider ends a literal earlier (MySQL backslash escapes, PostgreSQL dollar quotes, T-SQL ]],
nested comments, MySQL # / "--x", bare-CR line comments, Oracle q'..'). All 13 bypass strings were
accepted; the MySQL and PostgreSQL ones were executed against the live fixtures and the smuggled
UPDATE committed past the always-rolled-back transaction.
- SqlReadOnlyStatement (own file) lexes per provider and REFUSES constructs dialects disagree on;
  Odbc / no provider = every dialect must agree. Factory and AdminUI form pass the provider; the form
  re-validates queries on a provider change.
- ISqlDialect.BeginNamedQueryAsync / SealNamedQueryCommand / EndNamedQueryAsync: PostgreSQL and Oracle
  SET TRANSACTION READ ONLY; MySQL read-only session + transaction (restored after); PostgreSQL rewrites
  @name markers to positional $n (a parameterless query gets one unused typed $1) so Npgsql sends the
  text unsplit and the server refuses a second statement.

#987 (S-6) — key-value rows are attributed by SqlKeyMatcher (exact, then typed / padding-insensitive,
then case/accent-insensitive — only for rows the server matched); a named query's rowKey uses the
exact + representational stages only.
#987 (S-10) — SQL Server table writes read the target statement's own @@ROWCOUNT through an OUTPUT
parameter; SqlClient's ExecuteNonQuery sums trigger DML (reproduced: 1 + 2 audit rows = 3, every write
rolled back BadConfigurationError).

Tests: per-dialect bypass theory + positive controls, matcher + SQLite collation/affinity attribution,
Postgres seal, dialect-hook wiring, SQL Server write-plan capture; live NamedQueryBypassLiveTests
(PG/MySQL/Oracle), SqlServerTriggerWriteLiveTests, MySQL writing-function now refused.
2026-12-03 10:33:45 -05:00
Joseph Doherty d66aa5e9ff fix(galaxy): #991 G-5 the per-event subscriber lookup no longer allocates and the pump reuses one handle per subscription 2026-12-03 10:28:36 -05:00
Joseph Doherty 9ba33e7caa fix(galaxy): #991 G-1 authored SecuredWrite/VerifiedWrite tags route to WriteSecured without DiscoverAsync (security map seeded at init and on redeploy) 2026-12-03 10:25:53 -05:00
Joseph Doherty dd1d02e25f fix(historian): #993 gateway read refusals no longer degrade health, QuestDB reverse events read finds its cut by backward scan, time-weighted aggregator stops allocating per sample
G-9: a gateway-answered InvalidArgument/OutOfRange/NotFound/Unimplemented read is a connectivity observation (open, streak ends), not a failure; outages still degrade.
G-17: capped reverse/end-only QuestDB events reads find the n+1-th latest ts with an early-exit backward scan, then read ts >= cut ordered (ts DESC, event_id DESC).
G-18: Distribute takes a bridged/nonGood flag instead of per-sample delegates (O(buckets) allocation).
QuestDB integration fixture waits up to 60 s for WAL visibility (shared host is CPU-saturated; the 5 s production default made alarm-writer tests read back fewer rows).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:24:50 -05:00
Joseph Doherty bf0440776b fix(galaxy): #991 G-4/G-6 a change dropped by the full event channel is re-advised once it drains; same-session re-advises release the handles they supersede 2026-12-03 10:21:52 -05:00
Joseph Doherty f47ff00c92 Merge #992: OpcUaClient indexed recovery re-publish, safe unsubscribe ordering, Bad publish for refused refs, post-dispatch BadTimeout, IPv6 probe preflight 2026-12-03 10:21:21 -05:00
Joseph Doherty 888bc73c0d fix(opcuaclient): #992 G-10..G-15 recovery re-publish indexed, unsubscribe ordering, subscribe refusals published Bad, non-condition events dropped, post-dispatch write failures BadTimeout, dual-mode probe preflight
Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:21:07 -05:00
Joseph Doherty 9d1e6e8b86 Merge #989: MTConnect condition last-wins in /sample, subscription release on shutdown, restart re-baseline, parser skips bad observations, subscribe/unsubscribe races 2026-12-03 10:16:27 -05:00
Joseph Doherty af32984383 fix(mtconnect): #989 condition word last-wins on /sample, subscriptions released on shutdown, read-path restart re-baselines, malformed observation skipped not fatal, replay cannot overwrite a newer value, unsubscribe cannot kill a concurrent subscribe's pump
Review 2026-12-02 M-4, M-5, M-7, M-8, M-9 (MTConnect half), M-10.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-03 10:16:12 -05:00
Joseph Doherty 660a2ce9c0 fix(galaxy): #991 G-2/G-3 limit-bit qualities map without a per-event warning; a cleanly completed deploy-watch stream is re-subscribed with backoff 2026-12-03 10:15:00 -05:00
Joseph Doherty cfd453ae34 fix(heidenhain): #990 deterministic control-loop stop, stable down-host status, throttled optional-role login, backoff survives re-init 2026-12-03 10:12:29 -05:00
Joseph Doherty 89c7f5d49c fix(s7): #986 out-of-range/unconvertible scalar write values report BadOutOfRange/BadTypeMismatch without degrading health 2026-12-03 10:06:52 -05:00
Joseph Doherty be5641fc06 Merge #985: FOCAS closes session on protocol desync, refusals keep health, dead CNC no longer stalls others, slot indexes kept 2026-12-03 10:05:04 -05:00
Joseph Doherty e68d856fcb fix(focas): #985 refusals stay Healthy, protocol faults close the session, dead CNCs no longer stall others
- P-6: the wire adapter throws refused fixed-tree calls as FocasWireException carrying the rc
  (was InvalidOperationException, so a refusing control looked silent, degraded and was
  reconnect-looped by the #527 watchdog); a refused axis is per-node BadNoData and the tick continues.
- P-7: bootstrap capability probes latch only an ANSWER (rc, or session still up); a transport
  failure/timeout or a session dropped mid-pass retries the bootstrap.
- P-21: CoalesceRejected latches only range-shaped codes (not EW_BUSY/EW_SOCKET/EW_UNEXP/EW_HANDLE/unknown).
  Macro/param multi-block batching deferred (unproven on hardware).
- P-10: any fault once a request is on the wire closes the session (bad magic/version, unexpected
  PDU, malformed blocks); replies must echo the request's command ids in order (verified against
  every 31i-B capture). A refusal never closes the session.
- P-8: close handshake bounded to 1 s and run under the request gate (sync + async dispose).
- P-11: data-path callers check the backoff before ConnectGate and fail fast behind an in-flight
  reconnect to a device whose last connect failed.
- P-9: axes/spindles carry their wire slot (FocasAxisName/FocasSpindleName.Slot); cnc_rddynamic2 and
  the spindle-meter lookup use it.
- P-20: a truncated (>= 32) alarm list never clears/retriggers a told-active condition unless it
  shows a new key; unseen told keys are kept.
- P-25: a refused connect-time sysinfo is not cached; a short PARAM payload reads BadTypeMismatch.

Tests: loopback MockFocasWireServer drives the real wire client; every fix mutation-checked
(reverting it fails its test). FOCAS.Tests 619/619, FOCAS.IntegrationTests 19/19 vs the sim on
10.100.0.35, Runtime.Tests FOCAS 7/7, FOCAS.Cli.Tests 57/57.
2026-12-03 10:04:42 -05:00
Joseph Doherty 864843e4d9 Merge #982: TwinCAT re-resolves symbols after online change/download, dead device fails fast, refusal ≠ comms fault 2026-12-03 10:04:34 -05:00
Joseph Doherty 0eb620a223 fix(twincat): #982 symbol-table changes re-resolve on a fresh client; one dead device no longer stalls the rest
Review 2026-12-02 (09-ab-twincat-focas.md) TwinCAT findings:

- P-1: a stale client (ADS symbol-version event, a 1809, an invalidated
  notification, a probe non-Run -> Run transition, or a moved OnlineChangeCnt
  sampled every healthy probe tick) is never handed out again: the next call
  retires it (fresh Beckhoff symbol cache), native registrations replay on the
  fresh client (background or probe tick), its pushes are dropped, refused
  registrations re-arm, rediscovery is raised once per event. Verified against
  decompiled Beckhoff.TwinCAT.Ads 7.0.172: SymbolCache cleans itself only on
  the symbol-version event, which an online change does not raise.
- P-3: devices are read concurrently; the first comms failure on a device is
  checked against its ADS state once - gone => remaining tags fail fast with no
  wire attempt, alive => per-tag failure. Probe-unreachable devices fail fast;
  native subscribe applies the same rule.
- P-4: the probe connects without replaying registrations, probes, and
  re-registers only after the device answered; a replay against a dead device
  stops dialling it; one Warning per device per outage, Bad published once.
- P-12: unlisted device-layer ADS codes (0x700-0x73F) map to BadDeviceFailure
  (refusal, no health write, refusal backoff); 1817 DeviceTimeOut = BadTimeout;
  marshal/type read exceptions = BadTypeMismatch; the read guard refuses a
  scalar over a struct/FB (pointers/references still read as their address).
- P-19: symbol name / bit index pre-computed at init; health re-derived once
  per device per read call (health updates now serialised under a lock).
- P-22: the ADS client always carries the driver Timeout; the probe bounds
  only its own ReadState with Probe.Timeout.
- P-25: bit-indexed BOOL poll reads resolve the parent and read it at its own
  width; poll / notification / write agree on BadOutOfRange / BadTypeMismatch.

Tests: TwinCATReview20261202Tests (39 cases; the behavioural ones failed before
the fix). TwinCAT.Tests 712/712.
2026-12-03 10:04:09 -05:00
Joseph Doherty 77ba6d5f2b Merge #976: historian outages never dead-letter alarm history; gateway transient codes retry; outbox ack never drops an unindexed append 2026-12-03 10:03:50 -05:00
Joseph Doherty 07ee9e4888 fix(historian): #976 a historian outage no longer dead-letters alarm history, and an outbox ack never truncates an un-indexed value
G-16 / K-2 (LocalDbStoreAndForwardSink): a RetryPlease counts toward MaxAttempts only on a
drain where some event was Ack'd. A drain with no Ack is an outage: RetryPlease rows are left
untouched (no attempt, no dead letter), the backoff climbs to its 60 s cap, LastError reports
the deferral; PermanentFail rows still dead-letter. An outage longer than ~6.5 min used to
dead-letter the oldest queued alarm events, 100 more every ~10 min.

G-8 (GatewayAlarmHistorianWriter): only InvalidArgument/FailedPrecondition/OutOfRange/
NotFound/AlreadyExists/Unimplemented and unmappable events are PermanentFail; Cancelled,
Unknown, DataLoss, every unlisted code and every non-RPC transport exception retry (the
default used to be dead-letter, so a gateway restart dead-lettered a whole drained batch).

G-16 secondary (AlarmBatchWrite, both SQL writers): a multi-event chunk failing with an
error that is neither a recognised data error nor a known transient is re-sent event by
event, so one unrecognised poison event no longer drags its chunk-mates with it.

G-7 (FasterLogHistorizationOutbox): RemoveAsync of the newest indexed entry truncates to
that record's own end (recorded by the peek, else a one-record scan), never to the live
tail that may already hold an enqueued-but-unindexed append; peeks return only indexed
records so every peeked entry can be acked.

Tests: simulated multi-hour outage (fake clock, 200 drain cycles) loses 0 events and
drains in order on reconnect; positive controls for PermanentFail and a RetryPlease-forever
poison row getting exactly its MaxAttempts budget; gRPC/transport classification theory;
AlarmBatchWrite isolation + known-outage control; G-7 parked-append race + peek-only-indexed.
2026-12-03 10:03:25 -05:00
Joseph Doherty 40637b9954 Merge #983: AbCip dead device fails fast, BOOL arrays read in DWORDs, throttled logging, RMW lock + probe fixes 2026-12-03 10:00:15 -05:00
Joseph Doherty e6ca58148b fix(abcip): #983 packed structure reads, non-blocking lease release, allocation trims, docs (P-24)
Structure reads of a known size pack into one MSP; browse/template lease release no longer
blocks a thread-pool thread up to 2 s; scheduler packs with running totals; CipReply empty
extended-status array shared. AbCip.md documents P-2/P-13/P-16/P-22/P-23/P-24.
2026-12-03 10:00:00 -05:00
Joseph Doherty 7d6cf97fdd fix(abcip): #983 RMW lock keying + whole-word lock, bit selector 0-63, interval floors, cycle guard on struct type, browse surfaces transport faults (P-23 a-e) 2026-12-03 09:55:25 -05:00
Joseph Doherty c5c31a1671 fix(abcip): #983 whole BOOL-array read counts DWORDs (P-13); probe leases with the driver timeout (P-22) 2026-12-03 09:50:16 -05:00
Joseph Doherty b7d413366d Merge #984: AbLegacy unsupported types fail per-tag, bit arrays sized in words, Bit-without-/n RMWs bit 0 2026-12-03 09:47:29 -05:00
Joseph Doherty a9bc103eea fix(ablegacy): #984 per-tag family-type rejection + gate, bit arrays sized in words, Bit write RMWs bit 0, T/C/R read coalescing, answered-refusal/gate-race/null-write fixes
P-5 Long on MicroLogix/PLC-5 is BadConfigurationError per tag (init no longer throws), deploy gate warns via family-aware Inspect.
P-14 Bit array wire read sized in 16-bit words. P-15 Bit without /n RMWs bit 0; Bit on non-bit file refused.
P-18 native T/C/R sub-elements coalesce into one whole-element block read.
P-23f local OutOfBounds/TooLarge no longer count as answers, element/file >65535 is malformed; g block read re-resolves under the gate with identity-checked eviction; h null scalar write BadTypeMismatch.
2026-12-03 09:47:13 -05:00
Joseph Doherty eff7775bca fix(abcip): #983 a dead device no longer stalls the multi-device read batch and logs once per outage (P-2, P-16)
Scheduler faults everything queued behind a failed channel exchange; per-device read
windows plus a per-call fault latch fail a dead device's remaining items fast; throttled
creates no longer throw+log per tag (one Warning per device per outage, Info on recovery).
2026-12-03 09:45:29 -05:00
Joseph Doherty 388291d18a fix(modbus): #981 RTU-over-TCP discards the socket on caller cancel, re-subscribe republishes inside the deadband, DL205 non-octal C address is an error
S-1: ModbusRtuOverTcpTransport.SendOnceAsync tears the socket down on any exit after the write
without a validated reply (caller cancellation included), so a late reply can no longer answer
the next request at Good. S-2: SubscribeAsync/SubscribeAcquisitionAsync drop the deadband
baselines of their refs before polling starts. S-8: a family-recognised prefix whose body the
family parser rejects no longer falls through to the generic mnemonic table.
2026-12-03 09:42:30 -05:00
Joseph Doherty 647b7f631e feat(adminui): #954 OpcUaClient driver form field for AlarmRefreshRequiredMinInterval (+ round-trip and factory-parse tests) 2026-12-01 20:18:13 -05:00
Joseph Doherty f2757a52e2 Merge #944/#945: Galaxy clear-absent sweep on complete active-set reads recovers dropped Clears; provider_status/snapshot_status handled (counters), truncated snapshots withheld from known-state + sweep 2026-12-01 19:30:01 -05:00
Joseph Doherty 6d1d5ed559 fix(galaxy): clear told-active alarms absent from a complete snapshot (#944); handle provider_status/snapshot_status, withhold truncated snapshots (#945)
#944: a snapshot/QueryActiveAlarms lists active alarms only, so a Clear dropped while the
host's OnAlarmEvent handler was detached (or the stream was down) was never recovered. The
driver records which alarms it delivered as active; on a COMPLETE read (sentinel or re-read,
new IGalaxyAlarmFeed.ActiveSetDelivered, raised under the dispatch lock) it synthesises a
restatement Clear for told-active alarms of the live subscription the read does not name,
before the known-state signal. A re-read counts alarms the live stream restated meanwhile as present.

#945: provider_status / snapshot_status no longer fall to the decode-failure default (logged +
counters). A snapshot flagged truncated (snapshot_status or per-record flag) is not complete: no
sweep, no known-state signal; when the gateway clears the verdict the driver re-reads.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-01 19:29:41 -05:00
Joseph Doherty 0ccfd88a23 fix(opcuaclient): #946 rate-limit RefreshRequired sweeps; #947 refused per-ack status throws DriverOperationRefusedException
#946: AlarmRefreshRequiredMinInterval (default 10 s, 0 disables) spaces RefreshRequired-triggered ConditionRefresh sweeps per session; a request inside the window is deferred to its end and coalesced, never dropped.
#947: AcknowledgeAsync throws the breaker-exempt DriverOperationRefusedException for Bad per-ack statuses and unresolvable condition ids (BadConditionBranchAlreadyAcked is success) so the #760 revert fires. Docs reverse the O-8 decision.
2026-12-01 19:24:01 -05:00
Joseph Doherty c8b68940a8 Merge #926: OpcUaClient RefreshEnd signals initial alarm state only for a lossless bracket; post-signal loss withdraws known; deferred alarm/mark replay in arrival order; 2 review rounds 2026-11-28 10:26:58 -05:00
Joseph Doherty 06da40a909 fix(opcuaclient): #926 review r1 - loss after the signal withdraws known; gaps outside a bracket, overlapping starts, failed refreshes
- a sequence gap outside a bracket is a loss (re-refresh, same budget); older/repeated
  sequence numbers are ignored and not recorded
- AlarmInitialStateEventArgs.Withdrawn (additive): the driver withdraws 'known' once per
  signalled episode on its first loss; DriverHostActor sends MarkConditionsKnown(Known:false)
  for those conditions, drops them from the backstop and re-arms F5
- a RefreshStart while a bracket is open is a loss (never erases the open bracket's)
- a failed ConditionRefresh call is retried through the same bounded retry
- retry generation token (a finished retry never clears a newer retry's pending flag)
- spent budget renews after a 5-min cool-down; RefreshRequired sweeps coalesced
Red/green per fix (7 mutations) + live opc-plc gate re-run.
2026-11-28 10:07:08 -05:00
Joseph Doherty 99f2b9d8b7 fix(opcuaclient): RefreshEnd signals initial alarm state only for a lossless refresh bracket (#926)
Track RefreshStart..RefreshEnd per alarm subscription. EventQueueOverflow (matched by
EventType before the source filter - it comes from the Server object), RefreshRequired,
a publish-sequence gap the SDK skipped (EventFieldList.Message.SequenceNumber; SDK 2.0.1's
Republish publish-state never fires for a gap that blocks delivery) or a missing
RefreshStart suppress the A1 signal and re-run ConditionRefresh, bounded (3, 2/4/8 s);
exhausted = conditions stay unknown (Uncertain), never Unsignalable. Alarm event queue
1000 -> 10000; new counters alarm_event_queue_overflow / alarm_refresh_lossy.
Unit + real-SDK gap tests, live overflow gate on opc-plc --alm; plan G2 text corrected.
2026-11-28 09:42:06 -05:00