Code review 2026-12-02 WP3: Site runtime and data path correctness #154

Closed
opened 2026-12-02 16:06:54 -05:00 by dohertj2 · 1 comment
Owner

From the 2026-12-02 full code review (commits 28b6651a, f7e4f5b4: decisions accepted 2026-12-03).

  • Findings: docs/plans/2026-12-02-full-code-review.md
  • Plan: docs/plans/2026-12-02-full-code-review-remediation.md → WP3
Task Findings Change Verify
3.1 DCL-1 Flag seed values on TagValueReceived. Decided: drop a seed for any tag that has already delivered a live value in the current subscribe generation. Comparing timestamps was rejected: it depends on device and server clocks, and on the configured timestamp mode (see DCL-7). Actor test with a seed that arrives after a live value. Live check: reconnect on the rig.
3.2 DCL-2, DCL-3, DCL-8 Retry OPC UA alarm re-subscribe failures. Check the monitored-item create status. Put tags with connection-level failure rows into the retry set. DCL actor tests.
3.3 DCL-4, DCL-9 Cancel the re-subscribe loop when its session ends. Make the shared supervisory-advise task independent of the first caller's token. Tests.
3.4 DCL-5, DCL-6, DCL-7 Route alarm sources with a separator-aware prefix match. Browse/search reply with an error while disconnected. Reads honour the Server timestamp mode. Tests.
3.5 SF-1, SF-2 Keep per-target FIFO: the per-lane order must be by enqueue time, and a lane must not pass a still-pending older row. Classify a storage error after a successful delivery separately, so the delivery isn't repeated. S&F tests.
3.6 SRT-1, SRT-10 The watchdog detects a wedged run by deadline, not only by a blocked thread. Separate cancellation from timeout in the reported outcome. Tests.
3.7 SRT-2, SRT-3, SRT-4 A failed trigger evaluation keeps the previous state (no coercion to false) and logs a rate-limited event. RateOfChange clears when the value is flat. Start the WhileTrue timer when the condition is adopted from a seed. Alarm/script actor tests.
3.8 SRT-6 Decided: the DCL connection actor emits ConnectionQualityChanged(Good) when it re-enters Connected. The Instance Actor's Good branch only resets the Lever-1 subscribe backoff. It must not stamp bound attributes Good with their last-known values before the device re-reports. Test.
3.9 SRT-8, SRT-9, SRT-13 Script-facing Asks use the remaining deadline. Notify.Status checks the site-local store first. Remove the hard-coded 30 s routed-call cap (use the configured timeout). Tests.
3.10 SRT-11, SRT-12 A static write refreshes the quality/timestamp. The redeploy reset gate covers the full actor start. Tests.
3.11 CMN-3, CMN-4, CMN-10 The codec handles non-finite numbers and round-trips DateTime as UTC ISO-8601 with sub-second precision (a compatibility read accepts the old format). JSON null converts to null. Codec round-trip tests. Additive only, so the wire stays compatible.
From the 2026-12-02 full code review (commits 28b6651a, f7e4f5b4: decisions accepted 2026-12-03). - Findings: `docs/plans/2026-12-02-full-code-review.md` - Plan: `docs/plans/2026-12-02-full-code-review-remediation.md` → WP3 | Task | Findings | Change | Verify | |---|---|---|---| | 3.1 | DCL-1 | Flag seed values on `TagValueReceived`. **Decided:** drop a seed for any tag that has already delivered a live value in the current subscribe generation. Comparing timestamps was rejected: it depends on device and server clocks, and on the configured timestamp mode (see DCL-7). | Actor test with a seed that arrives after a live value. Live check: reconnect on the rig. | | 3.2 | DCL-2, DCL-3, DCL-8 | Retry OPC UA alarm re-subscribe failures. Check the monitored-item create status. Put tags with connection-level failure rows into the retry set. | DCL actor tests. | | 3.3 | DCL-4, DCL-9 | Cancel the re-subscribe loop when its session ends. Make the shared supervisory-advise task independent of the first caller's token. | Tests. | | 3.4 | DCL-5, DCL-6, DCL-7 | Route alarm sources with a separator-aware prefix match. Browse/search reply with an error while disconnected. Reads honour the `Server` timestamp mode. | Tests. | | 3.5 | SF-1, SF-2 | Keep per-target FIFO: the per-lane order must be by enqueue time, and a lane must not pass a still-pending older row. Classify a storage error after a successful delivery separately, so the delivery isn't repeated. | S&F tests. | | 3.6 | SRT-1, SRT-10 | The watchdog detects a wedged run by deadline, not only by a blocked thread. Separate cancellation from timeout in the reported outcome. | Tests. | | 3.7 | SRT-2, SRT-3, SRT-4 | A failed trigger evaluation keeps the previous state (no coercion to false) and logs a rate-limited event. RateOfChange clears when the value is flat. Start the WhileTrue timer when the condition is adopted from a seed. | Alarm/script actor tests. | | 3.8 | SRT-6 | **Decided:** the DCL connection actor emits `ConnectionQualityChanged(Good)` when it re-enters Connected. The Instance Actor's Good branch only resets the Lever-1 subscribe backoff. It must **not** stamp bound attributes Good with their last-known values before the device re-reports. | Test. | | 3.9 | SRT-8, SRT-9, SRT-13 | Script-facing Asks use the remaining deadline. `Notify.Status` checks the site-local store first. Remove the hard-coded 30 s routed-call cap (use the configured timeout). | Tests. | | 3.10 | SRT-11, SRT-12 | A static write refreshes the quality/timestamp. The redeploy reset gate covers the full actor start. | Tests. | | 3.11 | CMN-3, CMN-4, CMN-10 | The codec handles non-finite numbers and round-trips DateTime as UTC ISO-8601 with sub-second precision (a compatibility read accepts the old format). JSON null converts to null. | Codec round-trip tests. Additive only, so the wire stays compatible. |
dohertj2 added the type:review-findingpriority:p1 labels 2026-12-02 16:06:54 -05:00
Author
Owner

Fixed on main (pushed, 922021c4). Plan: docs/plans/2026-12-02-full-code-review-remediation.md (see its Outcome section).

All 11 tasks done. No migrations and no wire change.

  • 3.1: a seed is dropped for a tag that already delivered a live value in the current subscribe generation; an initial subscribe uses the latest live value instead.
  • 3.8: on reconnect, ConnectionQualityChanged(Good) only resets the subscribe backoff.

Follow-up: immediate delivery (S&F enqueue, CachedCall, CachedWrite) no longer overtakes buffered rows of the same lane (8267ab8f).

Rig: a site NodeA restart plus failover drill PASS. Reconnect-with-seed was covered by the actor tests; it was not separately drilled live.

Commits:

  • 455f1ff2 test(site-runtime): starvation test asserts a timed-out eval resolves as unknown, not false (SRT-2, WP3 task 3.7)
  • d639bd67 fix(site-runtime): static write refreshes quality/timestamp; redeploy reset gates native rehydration and the first flush (SRT-11, SRT-12, WP3 task 3.10)
  • b0c40dee fix(site-runtime): script Asks honour the run deadline, Notify.Status checks the buffer first, routed calls wait for the script's own timeout (SRT-8, SRT-9, SRT-13, WP3 task 3.9)
  • bc7fae26 fix(site-runtime): failed trigger evaluation keeps state, RateOfChange clears when flat, WhileTrue re-fires after seed adoption (SRT-2, SRT-3, SRT-4, WP3 task 3.7)
  • a730bc05 fix(site-runtime): watchdog follows the run across awaits; only the run's own deadline is a timeout (SRT-1, SRT-10, WP3 task 3.6)
  • c000ee32 fix(dcl): separator-aware alarm routing, typed reply for browse/search while disconnected, server-timestamp fallback (DCL-5, DCL-6, DCL-7, WP3 task 3.4)
  • d52aff1b fix(dcl): bind the reconnect re-subscribe loop to its session; shared supervisory advise ignores the first caller's token (DCL-4, DCL-9, WP3 task 3.3)
  • 2e8bede3 fix(dcl): retry failed alarm re-subscribes, check alarm item create status, retry connection-level re-subscribe rows (DCL-2, DCL-3, DCL-8, WP3 task 3.2)
  • 6adfc9f4 fix(dcl): seeds never overwrite a newer live value; Good on reconnect resets only the subscribe backoff (DCL-1, SRT-6, WP3 tasks 3.1 + 3.8)
  • 1aa8710e fix(sf): per-lane due-ness keeps per-target FIFO; post-delivery storage error is not a delivery failure (SF-1, SF-2, WP3 task 3.5)
  • 405ca636 fix(commons): codec handles non-finite list floats, ISO-8601 UTC scalar DateTime, JSON null converts to null (CMN-3, CMN-4, CMN-10, WP3 task 3.11)

Deploying to QA and DEV is tracked in #160. Closing.

Fixed on `main` (pushed, `922021c4`). Plan: `docs/plans/2026-12-02-full-code-review-remediation.md` (see its Outcome section). All 11 tasks done. No migrations and no wire change. - **3.1:** a seed is dropped for a tag that already delivered a live value in the current subscribe generation; an initial subscribe uses the latest live value instead. - **3.8:** on reconnect, `ConnectionQualityChanged(Good)` only resets the subscribe backoff. **Follow-up:** immediate delivery (S&F enqueue, `CachedCall`, `CachedWrite`) no longer overtakes buffered rows of the same lane (8267ab8f). **Rig:** a site NodeA restart plus failover drill PASS. Reconnect-with-seed was covered by the actor tests; it was not separately drilled live. **Commits:** - 455f1ff2 test(site-runtime): starvation test asserts a timed-out eval resolves as unknown, not false (SRT-2, WP3 task 3.7) - d639bd67 fix(site-runtime): static write refreshes quality/timestamp; redeploy reset gates native rehydration and the first flush (SRT-11, SRT-12, WP3 task 3.10) - b0c40dee fix(site-runtime): script Asks honour the run deadline, Notify.Status checks the buffer first, routed calls wait for the script's own timeout (SRT-8, SRT-9, SRT-13, WP3 task 3.9) - bc7fae26 fix(site-runtime): failed trigger evaluation keeps state, RateOfChange clears when flat, WhileTrue re-fires after seed adoption (SRT-2, SRT-3, SRT-4, WP3 task 3.7) - a730bc05 fix(site-runtime): watchdog follows the run across awaits; only the run's own deadline is a timeout (SRT-1, SRT-10, WP3 task 3.6) - c000ee32 fix(dcl): separator-aware alarm routing, typed reply for browse/search while disconnected, server-timestamp fallback (DCL-5, DCL-6, DCL-7, WP3 task 3.4) - d52aff1b fix(dcl): bind the reconnect re-subscribe loop to its session; shared supervisory advise ignores the first caller's token (DCL-4, DCL-9, WP3 task 3.3) - 2e8bede3 fix(dcl): retry failed alarm re-subscribes, check alarm item create status, retry connection-level re-subscribe rows (DCL-2, DCL-3, DCL-8, WP3 task 3.2) - 6adfc9f4 fix(dcl): seeds never overwrite a newer live value; Good on reconnect resets only the subscribe backoff (DCL-1, SRT-6, WP3 tasks 3.1 + 3.8) - 1aa8710e fix(sf): per-lane due-ness keeps per-target FIFO; post-delivery storage error is not a delivery failure (SF-1, SF-2, WP3 task 3.5) - 405ca636 fix(commons): codec handles non-finite list floats, ISO-8601 UTC scalar DateTime, JSON null converts to null (CMN-3, CMN-4, CMN-10, WP3 task 3.11) Deploying to QA and DEV is tracked in #160. Closing.
Sign in to join this conversation.