Ab.Transport: EncapsulationClient drain/timeout/test follow-ups #565

Closed
opened 2026-10-07 19:02:13 -04:00 by dohertj2 · 1 comment
Owner

Context: native .NET Allen-Bradley transport work (plan docs/plans/2026-10-07-native-ab-transport.md, branch feat/native-ab-transport, not yet merged). Parked as a Minor during per-task review — none of these block the plan.

EncapsulationClient (Ab.Transport/Eip) follow-ups:

  • Writes use CancellationToken.None (constraint-mandated so a half-written frame never desyncs the stream) — revisit whether a bounded write timeout is wanted.
  • An infinite Timeout would let a cancelled-reply drain hold the single-flight gate forever. Confirm ConnectionOptions validation rejects non-finite/non-positive timeouts everywhere a client is built.
  • The gate wait is bounded only by the caller's token.
  • Several tests rely on 300 ms timing windows — convert to deterministic signals.
  • No test for dispose-during-drain.
  • RegisterSession now sends a zero sender context (ab_server rejects non-zero) and its reply matches only via the "ctx == 0" tolerance rule — add a comment/test documenting that dependency.
Context: native .NET Allen-Bradley transport work (plan `docs/plans/2026-10-07-native-ab-transport.md`, branch `feat/native-ab-transport`, not yet merged). Parked as a Minor during per-task review — none of these block the plan. `EncapsulationClient` (`Ab.Transport/Eip`) follow-ups: - [ ] Writes use `CancellationToken.None` (constraint-mandated so a half-written frame never desyncs the stream) — revisit whether a bounded write timeout is wanted. - [ ] An infinite `Timeout` would let a cancelled-reply drain hold the single-flight gate forever. Confirm `ConnectionOptions` validation rejects non-finite/non-positive timeouts everywhere a client is built. - [ ] The gate wait is bounded only by the caller's token. - [ ] Several tests rely on 300 ms timing windows — convert to deterministic signals. - [ ] No test for dispose-during-drain. - [ ] RegisterSession now sends a zero sender context (ab_server rejects non-zero) and its reply matches only via the "ctx == 0" tolerance rule — add a comment/test documenting that dependency.
dohertj2 added the driver/abcipdriver/ablegacy labels 2026-10-07 19:02:13 -04:00
Author
Owner

Fixed: writes awaited under the exchange timeout and fault (tear down) the client on expiry — never cancelled mid-frame; non-finite/non-positive timeouts rejected at every entry point; gate wait bounded by the call timeout; ordering race made deterministic; dispose-during-drain test; RegisterSession zero-context dependency documented + tested. Residual: no unit test for the write-timeout path itself (needs a peer that stops reading with full socket buffers; one EIP frame can't fill loopback buffers). (merge 13a67270 on master, pushed 2026-10-08)

Fixed: writes awaited under the exchange timeout and fault (tear down) the client on expiry — never cancelled mid-frame; non-finite/non-positive timeouts rejected at every entry point; gate wait bounded by the call timeout; ordering race made deterministic; dispose-during-drain test; RegisterSession zero-context dependency documented + tested. Residual: no unit test for the write-timeout path itself (needs a peer that stops reading with full socket buffers; one EIP frame can't fill loopback buffers). (merge `13a67270` on master, pushed 2026-10-08)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#565