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.
This commit is contained in:
@@ -191,7 +191,7 @@ The driver has two interchangeable wire transports, selected by one `DriverConfi
|
||||
a held connection idling out, so this shape follows a controller restart / re-download or a network gap.
|
||||
- `ConnectionSize` / `Timeout` / `AllowPacking` are honoured per pooled connection, and the **first**
|
||||
driver/device to open a given device key wins — including a Test Connect probe on a fused `admin,driver`
|
||||
node (its connection carries the probe timeout). A later opener with different options is ignored and
|
||||
node (a Test Connect probe carries its own probe timeout). The driver's own probe loop leases with the DRIVER's `Timeout` and bounds only its wait with the probe timeout (#983 P-22: it used to lease with the probe's, so a short probe timeout became every data read's). A later opener with different options is ignored and
|
||||
logged once as a Warning (`DeviceSessionPool`). ⚠️ The device key compares the **host string**, so the
|
||||
same controller addressed by DNS name in one driver and by IP in another gets two connections and two
|
||||
Forward Open throttles (up to two opens per second); address a controller the same way everywhere. ControlLogix, GuardLogix and (since T21) CompactLogix default to 4002, a Large
|
||||
@@ -517,6 +517,9 @@ UDT-typed tags found in the walk.
|
||||
|
||||
## Operational Notes
|
||||
|
||||
- **A dead device does not stall the others, and logs once (#983, review 2026-12-02 P-2/P-16).** Three layers: (1) the native request scheduler faults everything queued behind a failed *channel* exchange (timeout / closed session / failed open) with the same exception — it used to start one fresh attempt per queued batch, ~N/20 timeouts for a 1000-tag device; a request submitted afterwards is a fresh attempt, so recovery is not delayed; (2) `ReadAsync` keeps one read window **per device** and a per-call fault latch — the first connection-level failure of a device (`Timeout`/`BadConnection`/`Abort`, not a device refusal) makes that device's remaining items fail fast `BadCommunicationError` and evicts their handles, so the next poll goes through the cold-create backoff instead of the wire; (3) per-read comms failures log one Warning **per device per outage** (Debug after), a throttled create no longer logs per tag, and the first success logs one Info with the suppressed count. The latch is deliberately per call and does not open the connect backoff itself: a transient single failure must still re-create the handle on the next read (`AbCipDriverCodeReviewRegressionTests`).
|
||||
- **Whole BOOL-array reads count DWORDs (#983, P-13).** A Logix `BOOL[n]` is `ceil(n/32)` DWORDs (type `0xD3`) and a Read Tag's element count is in DWORDs; the native runtime now asks for that and, when the reply type is `0xC1` (one byte per BOOL, as `ab_server` answers), re-reads once with `n` and remembers it. **Not hardware-verified** — the unit evidence is a fake controller that refuses a 64-element read of `BOOL[64]`; the live gate is a whole read of a real `BOOL[64]`. Controller *browse* still maps symbol type `0xD3` to `Structure` (no hardware capture of the symbol-listing dims for a BOOL array exists), so browse-commit does not yet produce a correct Bool-array tag.
|
||||
- **Bit selector 0..63; whole-word writes share the RMW lock (#983, P-23).** `Tag.n` accepts 0..63 (a LINT host); the width check refuses a bit the host does not have. A whole-word write to an integer tag takes the same per-parent lock as the bit read-modify-writes of `Tag.n` (case-insensitive, like the parent runtime table), so neither can land between the other's read and write. Probe / alarm-poll intervals are floored at 100 ms at config parse (0 hot-looped, negative killed the loop). The discovered-UDT cycle guard keys on the struct *type* (template id), not the member name, so a nested member sharing its parent's name is browsed. A connection-level fault reading a program's symbol listing now aborts the browse instead of silently dropping the program.
|
||||
- **Native heap is invisible to the GC.** libplctag's native `Tag` heap does not show up in CLR allocation figures. Watch whole-process RSS, and use `ReinitializeAsync` (tears down + re-creates every device's libplctag handles) as the remediation for native-heap growth. (There is no per-driver footprint number to consult: `IDriver.GetMemoryFootprint()` was deleted as unconsumed in Gitea #525.)
|
||||
- **Handle eviction on failure** — a non-zero libplctag status or a transport exception evicts the cached tag runtime so the next read/write re-creates a fresh handle, mirroring the probe loop's recreate-on-failure behaviour.
|
||||
- **Read statuses carry the libplctag cause** — a tag the controller does not have reads `BadNodeIdUnknown` (not `BadCommunicationError`), and it does **not** open the device's connect-backoff window (the controller answered; before this, one typo throttled every sibling tag on the device). A genuine connection failure still opens it.
|
||||
|
||||
Reference in New Issue
Block a user