perf(acl,grpc-data): #1053 alloc-free warm UNS ACL decisions; unresolvable configured refs back off; restart keeps the comms latch (decided)

U-8: a warm cached decision on a UNS node allocated 416-680 B/call ahead of the cache (live id-chain list, identifier
split, LINQ, segment array, string.Join key, DataCallerIdentity). Now 0 B: the live chain is cached per folder instance
(re-verified against the live ancestry every call), the generation hands out one segment array per path, the authorizer
keys its resolved cache keys on that array, reference variables key on their own identifier (scope = its split), and
the caller identity is built once per session identity.

R-25: ConfiguredProjectedInterestOwner re-ran discovery for an unresolvable configured reference every 1 s sweep forever;
a failed resolve now backs off 1 s doubling to 30 s (60 s unreachable: 61 discoveries -> 6). Publishing into the source hub
only for sources with interest is DECLINED: that cache answers a new subscription's first snapshot and projected Reads.

Restart comms latch (decided: keep): the nodes stay Bad across an operator Restart and the respawned incarnation must
re-publish them; the stopped child's PostStop announcement already re-latches and cancels the old audit. Pinned by test.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-12-03 15:30:07 -05:00
parent a24071405a
commit 6ea0f09614
11 changed files with 586 additions and 37 deletions
+9
View File
@@ -262,6 +262,15 @@ items or an origin is busy.
per-parent child count). Removing a projected anchor, or swapping it for a root leaf, now also tombstones the anchor's
own monitored node. Removing an imported condition purges only its own cached verdicts.
- **An unresolvable configured reference backs off (#1053, R-25).** `ConfiguredProjectedInterestOwner`'s shared 1 s sweep
used to re-run discovery for every desired reference with no lease, every second, for as long as the interest lasted.
A failed resolve now waits 1 s, doubling to a 30 s ceiling, before the sweep tries it again (an explicit interest change
still re-queues at once; a held lease is still re-checked every sweep). 60 s of an unreachable origin: 61 discoveries ⇒ 6.
- **Not changed, by decision (#1053, R-25):** the driver callback still publishes every value into the source hub whether
or not a gRPC consumer is subscribed. That cache is what a new subscription's first snapshot and a projected Read are
answered from (a gRPC-demanded source switches to acknowledged acquisition instead), so publishing "only with interest"
would leave a slow-changing tag with no first value. The R-3 trigger it fed is closed by the #994 re-queue above.
Perf harness: `GrpcDataWave3PerfTests` (`Category=Perf`, opt-in `OTOPCUA_GRPCDATA_PERF=1`).
### Mixed versions (X0 rollout)
+4
View File
@@ -596,6 +596,10 @@ Warning / counter increment and a disable then re-enable of the same id never in
holds the id in the `ChildHealthLedger` (`Forget` then `Readmit` on the next spawn), so the stopped child's late health
publish cannot resurrect its diagnostics entry.
An operator **Restart** deliberately KEEPS the latch (#1053): the nodes stay in the address space, still Bad, and the
respawned incarnation is what must re-publish them. The stopped incarnation's `PostStop` comms-loss announcement re-latches
the current ref set and cancels the audit the old incarnation armed; the new incarnation's `Connected` re-arms it.
### The connect path feeds the circuit breaker (R2-10 T10 closure)
`IDriver.InitializeAsync` is routed through the capability invoker as
+9
View File
@@ -1148,6 +1148,15 @@ device folder asks once per child. Those seams go through a per-`(session, node,
decision cache (`SessionAclDecisionCache`), cleared wholesale whenever the authority generation
advances.
**A warm cached decision on a UNS node allocates nothing (#1053, review U-8).** The UNS placement still runs on
every call, ahead of the cache (it reads live topology), but its products are cached: the node manager keeps each UNS
folder's live id chain on the folder instance (re-verified against the live ancestry on every call, rebuilt on any
mismatch), the generation hands out one segment array per folder/equipment path, and the authorizer keys its resolved
cache keys on that array. A reference variable is keyed on its own identifier (its scope is its split, the same key a
Path-kind lookup uses), and the caller's `DataCallerIdentity` is built once per session identity. Measured warm per call:
equipment folder 416 → 0 B, folder-owned virtual tag 592 → 0 B, UNS reference variable 680 → 0 B
(`NodeManagerUnsDecisionAllocationTests`).
⚠️ **The cache holds the grant walk, not the decision.** Grants, principals and the trie are all fixed
for the life of a generation, so memoizing the walk is sound. A key's `ExpiresUtc` passes with the
*clock*, not with a deployment — so revocation and expiry are re-checked on every call, outside the