50 lines
4.7 KiB
Markdown
50 lines
4.7 KiB
Markdown
# #927 — live gate: driver-failure ack revert through DriverHostActor under the connection service principal
|
|
|
|
A2b (remote `CallConditionMethod`) had been gated live only for a scripted condition. The path where a remote ack of a
|
|
**native** condition reaches a driver that fails it, and DriverHostActor reverts the node (`RevertNativeAlarmAck`,
|
|
`AlarmStateUpdate(EstablishesState: false)`), was unit-tested only (`ConditionMethodNodeManagerTests`, A2.md "Driver failure
|
|
revert seen in the stream"). This adds scenario **A09** to `scripts/validation/grpc-data/conditions_scenarios.py` and runs it.
|
|
|
|
## How the driver is made to fail (a real failure, no seam)
|
|
|
|
The conditions profile's SOURCE `OpcUaClient` driver `source-opcua` watches the run-owned `opc-plc:2.14.10 --alm` native alarm
|
|
`EastTankYellow`. A09 `docker compose pause`s the `opcplc` container immediately before the consumer's ack. The driver is still
|
|
`Connected` (its keep-alive has not yet noticed), so `OpcUaClientDriver.AcknowledgeAsync` sends the upstream
|
|
`AcknowledgeableConditionType.Acknowledge` call and gets **no reply**; the SDK call fails with a `ServiceResultException`
|
|
(request timeout) inside the 5 s ack window, `DriverInstanceActor.HandleAcknowledgeAsync` reports `AlarmAckFailed`, and
|
|
DriverHostActor reverts. The container is unpaused in the scenario's `finally` (and again by the per-scenario restore if it
|
|
was left paused). Pausing also freezes opc-plc's own alarm cycling, so no upstream transition can explain the
|
|
Unacknowledged that follows the ack.
|
|
|
|
**Why not an upstream refusal.** The option the issue suggests — an upstream that answers the Acknowledge with a Bad status
|
|
(stale EventId, already acked) — does **not** revert today: `OpcUaClientDriver.AcknowledgeAsync` only logs a per-ack Bad
|
|
result (and an ack whose condition id resolves to nothing), by design (`docs/drivers/OpcUaClient.md`: "a reply still returns
|
|
normally, including per-ack refusals … a refusal is the server answering"), to keep refusals off the AlarmAcknowledge breaker.
|
|
`DriverOperationRefusedException` now exists for exactly that (breaker-exempt, reverts), so an upstream refusal leaving the
|
|
node Acknowledged is a gap — reported as a follow-up, not changed here (it reverses a documented driver decision). A
|
|
no-reply transport failure is the failure class the driver does surface, and it exercises the whole revert path.
|
|
|
|
## Result — run `a927-1`, 2026-11-28, HEAD `cdbbe22a9`: A09 **PASS** (12/12)
|
|
|
|
`rig.py up --conditions` → `seed` → 85 s → `deploy --timeout 300` → `conditions_scenarios.py --only A09` → `rig.py down`
|
|
(0 run containers, 0 run volumes).
|
|
|
|
| Check | Evidence |
|
|
|---|---|
|
|
| native condition present on both sides, Unacknowledged | consumer `EastTankYellow` `Inactive, Unacknowledged` (opaque `ns=6;s=c1.…` id), origin `ns=2;s=opcua/opcplc/EastTankYellow` same record time |
|
|
| caller gets Good | 15:13:40 `opcplc` paused; consumer CLI `ack` ⇒ `Acknowledge successful` (plan §5.6 step 5: native ⇒ Good, `AcceptedUnconfirmed`; the failure reaches the caller as the revert) |
|
|
| audit records the remote call | origin `source-1`: `Data-connection condition method Acknowledge by fixture-consumer (key …) on Raw:…:opcua/opcplc/EastTankYellow op a3-…: AcceptedUnconfirmed 0x00000000; on behalf of fixture-cli` — the connection's **service principal** (`fixture-consumer`) on behalf of the end user |
|
|
| the driver really failed | 15:13:46 `DriverInstance source-opcua: native-alarm acknowledge of opcua/opcplc/EastTankYellow failed` |
|
|
| DriverHostActor reverted (EstablishesState: false) | 15:13:46 `DriverHost source-1:4053: … did not reach the alarm system (the upstream acknowledge failed (ServiceResultException)); reverting the condition to unacknowledged` — `RevertNativeAlarmAck` is the only producer of that line and of an `EstablishesState: false` update |
|
|
| origin node applied, then reverted | origin Server-object events after the ack: `Inactive, Acknowledged` → `Inactive, Unacknowledged` (nothing else: upstream frozen) |
|
|
| consumer saw the reverted delta | consumer events after the ack: `Inactive, Acknowledged` → `Inactive, Unacknowledged`; same ConditionId, a new EventId |
|
|
| positive control | 15:13:48 unpaused; 30 s later the condition was `Active, Unacknowledged` (opc-plc had re-activated it; whether the paused call was later applied upstream is not observable from this state); a second consumer ack of the current EventId ⇒ Good and **no** new revert line in the next 15 s |
|
|
|
|
Evidence files (removed with the run folder; copies taken before `down`): `evidence/A4S-A09.json`, `A4S-results.md`, the CLI
|
|
`*.process.json` logs.
|
|
|
|
## Not covered
|
|
|
|
- The upstream-refusal flavour (Bad per-ack status) — it does not revert; follow-up above.
|
|
- `/alerts` (alarm-history) rows for the ack and its revert were not asserted.
|