- ProjectedDataAccess: internal queued/handled renewal-tick counters (RenewalTicksQuiescentForTests) so a test can wait until every tick a clock advance fired has been handled.
- ManualTimeProvider.AdvanceInOneStep: all timers see the final instant (successor lease is stamped from request start).
- Live_predecessor_cadence...: Task.Delay(20/100) pacing replaced by advance-and-settle; 10 s waits widened.
- Two_sdk_cadences...: 9 s jump in one step (deterministic successor issue time, fixes the 7.45 s margin flake); read each item's notifications until its expected value (8 vs 9 flake); barrier timeout widened.
Residual ~1% hang tracked in #968.
The Runtime.Tests flake (Changing_the_filter_acknowledges_a_new_revision_before_its_snapshot) was a real
production race. DataSubscriptionSession.TickAsync captures the snapshot-complete interest-group leases
under the gate, awaits the snapshot/condition pumps, then reads each lease's changes. A Modify that replaces
an item is committed on the DELIVERY side (the ack's commit -> CommitStaged -> ReleaseItem), which disposes
the replaced item's SourceInterestLease. If that lands between the capture and the read, TryReadChanges
returns false exactly like a lost history and the session answered a successful modify with
Reset: "Source change history expired." (ack, then Reset instead of SnapshotBegin).
InterestGroup now carries Released (set under the gate in ReleaseItem before the lease is disposed); the
tick skips a failed read of a group the session itself released - the replacement has its own snapshot.
A failed read of a group the session still owns is still a reset.
Regression test holds a tick at the capture point (BeforeDirtyTickForTests), commits the modify under it
via a gated transport write, then lets the tick read: red 3/3 before, green after. Stress of the original
scenario (5000 iterations x 6 widths): 137/30000 Reset before, 0/30000 after.
Grpc.Net.Client has no per-call receive limit, so Read/GetMetadata/Browse now go
through receive-bounded sibling channels (power-of-two size classes, min 16 KiB,
sharing the endpoint channel's handler). An oversized response to a scalar read is
refused from its length prefix instead of buffering up to MaxMessageBytes; such a
refusal stays a decode refusal (ArgumentException, no failover).
#960: a projected read reserves 16 KiB for a fixed-size scalar (16 KiB + 256 B/element for a
fixed-length fixed-size array) instead of the whole MaxPendingBytes, so the default 1 MiB admits
64 concurrent scalar reads; String/Bytes/variable arrays keep the whole cap, and a waiting
whole-cap read holds back smaller ones for 100 ms (anti-starvation). Writes reserve
16 KiB + identifiers + 3 x the value bound (what the origin's DataWriteExecutor admits the batch
against). Monitored-item renewals reserve 256 KiB. Measured: 4 x 250 ms maxAge=0 reads 1016 ms /
1 in flight -> 285 ms / 4 in flight.
#961: TryAcquireProjectedItem reports BadResourceUnavailable for a stream-capacity refusal; the
node manager's CreateMonitoredItem override turns the item manager's ServiceResultException into
that item's status (was a whole-request fault), and an authority race is re-classified outside
Lock like the per-item probe.
1. RawTreeService.UpdateTagAsync refuses the edit that makes a tag alarm-bearing while it roots an enabled
DataExport (RawTag, or UnsTagReference to it) with the #942 DataExportRootAlarmBearing text (shared constants).
DataConnectionAdminService refuses only errors a save/delete introduces or that remain on the saved row, so a
pre-existing invalid row no longer blocks unrelated rows (two invalid rows used to deadlock); deploy gate unchanged.
2. Origin: GetMetadata/Read/Subscribe/condition admission answer a node inside the grant that the origin ACL hides
(no Browse and no Read) NotFound, like a missing one (Browse omits it; HistoryRead/Write already uniform). Denied
stays for visible nodes. Consumer renewal treats NotFound like Denied (#939 Refused), so tightening the ACL on a
projected node still reads BadUserAccessDenied.
The deploy compose's SERIALIZABLE transaction range-locked every config table for the whole
validate+compose+gzip: a concurrent edit held the deploy (as long as its lock), was held by it,
or deadlocked with it (reproduced on SQL Server: ~5 s per deadlock-monitor cycle, the deploy the
victim 9 of 10 times). SNAPSHOT reads take no shared locks; composes stay serialised by a
transaction-owned sp_getapplock taken before any data access (row-lock-first would fail a queued
compose with 3960). The #949 phase timer now starts at receipt (dispatch, in-flight-check).
The #923 gate's specific 10.5 s stall is not proven to be this mechanism (see evidence).
When the direct verdict ask expired before the engine reached it, or never started before its
asker's deadline, the host answered OutcomeUnknown and let the broadcast copy decide - but nobody
awaited that copy, so a local refusal left the SDK-applied node change until the next good deploy.
The host now keeps a pending decision per CommandId and returns it as the unknown answer's
LateOutcome; OnAlarmCommand settles it with the copy's local outcome (applied / refused / unknown /
not owned). The node manager's existing #951 chain follows it, so a refused copy reverts the node
under the per-condition mutation-counter guard (one chain, one terminal verdict - no double revert;
a newer change wins). Never-arriving copies settle unknown after 30 s; a stopping host settles its
pending decisions unknown; at most 1024 pending per host.
Tests: Runtime host tests (refused/applied copy settles the late outcome, copy-first answers
directly, window expiry, stop) - red without the LateOutcome wiring; wire test of the production
chain reverting exactly once, and not at all after a newer change (falsified by disabling the
mutation guard). Docs: ScriptedAlarms.md residual + #958 section, rules/alarms.md.
DataProtoMapper.DecodeMetadata decodes an undefined ValueKind / ArrayElementKind number to an unknown-kind
marker (DataMetadata.HasUnknownKind, ValidateDecoded) instead of throwing; Validate/Encode still refuse it.
The resolver's #941 IsMaterialisable skips the marker whatever its node kind (a Folder included); a remote
root carrying it is refused. An undefined per-item metadata status decodes to Unavailable (no value, no lease).
Unspecified (0), bad array shape, unknown realm and unknown branch status still fail closed.
#938: OtOpcUaNodeManager implements IReadAsyncNodeManager. A projected Value read whose maxAge the
cache cannot satisfy (0 always: Part 4 "read the source"; ScadaBridge's DCL and the Client CLI send
0) is served from IProjectedDataAccess.ReadNowAsync in the same request — same unary admission,
authenticated freshness-checked read and cache publication as ScheduleRead, pumped through the
unary budget, at most 5 s / request deadline − 250 ms, no Lock, no blocked thread. A lapsed lease
is renewed first and read in the same request. Previously every maxAge=0 read answered
BadWaitingForInitialData forever.
#939: RemoteNamespaceResolver.RenewExactOutcomeAsync reports Renewed/Refused/Failed. Refused only
for the origin's verdict (PERMISSION_DENIED call, Denied item, Metadata not granted, operation not
granted / not writable) ⇒ BadUserAccessDenied, held 5 s per node+operation unsent; transport and
other failures stay retryable. HistoryRead follows it.
#940: RenewLapsed accepts Write (gated on the local write role) and Subscribe. WriteAsync awaits the
renewal (≤ 4 s, ≤ half the timeout hint) then dispatches, BadResourceUnavailable unsent otherwise.
CreateMonitoredItems awaits renewals once per request (ICreateMonitoredItemsAsyncNodeManager) and
classifies each projected item PER ITEM outside Lock (lapse ⇒ BadResourceUnavailable, refusal ⇒
BadUserAccessDenied) — a refusal thrown from the item manager used to fault the whole request.
Red/green: 15 wire tests in GrpcDataProjectedOriginAccessWireTests (12 red on the pre-fix source,
controls green both ways); 4 existing tests updated where the first read is now Good. Evidence:
docs/plans/evidence/grpc-data-ext/938-939-940-948.md.
The /alerts buttons went central->node fire-and-forget and always showed
"Ack sent". AdminOperationsActor now spawns a per-request
AlarmCommandVerdictCollector (7 s window, under the client's 10 s ask) that
sends the command with AlarmCommand.VerdictRequested and gathers each node's
answer, finishing early once every node it sent to has answered.
- gRPC plane: CentralCommunicationActor tells the collector the dialled
ClusterNode set and one verdict per node. A node handles a
verdict_requested AlarmCommandMessage by asking its driver host
(ScriptedAlarmHostActor.ExecuteAlarmCommand, the #937 path, no ask deadline,
bounded 5 s) and returns it in the ADDITIVE ExecuteAck.alarm_verdict.
Transport failure / timeout / empty ack (pre-#950 node) => that node unknown.
- DPS: published with the collector as sender; each ScriptedAlarmHostActor
answers (non-owners NotOwned); expected set = Up driver members.
- Aggregation: any owner applied => Applied (partial noted); else any
unknown/silent node => Outcome unknown (never "refused"); else owner
refusal => Refused: <reason>; else no owner => Not applied.
- UI: green Applied / red Refused (reason) / amber Outcome unknown, per-node
detail in the details pane; a verdict-less reply (validation, server fault,
pre-#950 singleton) renders as before.
Wire is back-compatible both ways (new proto fields only; VerdictRequested and
NotOwned default false). Real-wire test through the real router, dialer,
interceptor and NodeCommandGrpcService (red without the node change).
Co-Authored-By: Claude <noreply@anthropic.com>
#951: the hosted-service Ask lives LateVerdictWindow (30 s) past the caller's bound
(ExecuteAlarmCommand deadline unchanged); the OutcomeUnknown it returns carries the
still-running ask as AlarmCommandOutcome.LateOutcome (process-local). The node manager
watches it (or the asker task itself when its backstop expired, following unknown
chains) and reverts the node on a late NotApplied, under the existing per-condition
mutation-counter guard. Both CallAsync and remote ExecuteConditionMethodAsync paths.
#952: ScriptedAlarmEngine throws ScriptedAlarmCommandNotStartedException (an OCE) when a
command is cancelled before it acquires _evalGate; a cancellation inside SaveAsync stays
a plain OCE (unknown). The host maps not-started to NotApplied and remembers it, except on
the direct ask once its asker's deadline passed (asker already answered unknown and
broadcast): then unknown + not remembered, so the broadcast copy decides (as review r2 M2).
#953: a faulted load pipes back AlarmsLoadFailed(cause, generation); a failure from a
generation a newer apply superseded publishes no readiness (it would refuse every command
while the newer load is in flight).
Red/green: each fix reverted individually turns its tests red (Core 1, Runtime 3,
Host 1, OpcUaServer.IntegrationTests 4).
Co-Authored-By: Claude <noreply@anthropic.com>
#941: RemoteNamespaceResolver now skips an origin browse item this build cannot
materialise (NodeKind not Folder/Variable/Tag, or a value/array-element kind with no
OPC UA built-in type: Guid, Bytes) instead of failing the whole page, so one
UnsupportedVariable no longer makes the folder BadNoCommunication. Malformed items of a
supported kind still fail closed. New real-SDK wire tests: an injected unmaterialisable
child (4 kinds) is skipped across BrowseNext pages, and an empty Complete=false origin
page is paged through.
#942: DataConnectionValidator (authoring + DraftValidator deploy gate, not node-side
ValidateDeployed) refuses DataExportRootAlarmBearing: an export rooted at an
alarm-bearing RawTag (grants nothing) or at a UnsTagReference to one (no UNS node, so
the node's catalog compile throws and refuses the whole export set).
#943: GetMetadata, Read, Subscribe and condition-item admission answer an address
outside every export of the principal as NotFound, identical to a missing one
(LocalExportCatalog.DisclosesAddress replaces ContainsAddress). Denied stays for
addresses inside a grant. Browse, Write, HistoryRead and condition methods were
already uniform.
#944: a snapshot/QueryActiveAlarms lists active alarms only, so a Clear dropped while the
host's OnAlarmEvent handler was detached (or the stream was down) was never recovered. The
driver records which alarms it delivered as active; on a COMPLETE read (sentinel or re-read,
new IGalaxyAlarmFeed.ActiveSetDelivered, raised under the dispatch lock) it synthesises a
restatement Clear for told-active alarms of the live subscription the read does not name,
before the known-state signal. A re-read counts alarms the live stream restated meanwhile as present.
#945: provider_status / snapshot_status no longer fall to the decode-failure default (logged +
counters). A snapshot flagged truncated (snapshot_status or per-record flag) is not complete: no
sweep, no known-state signal; when the gateway clears the verdict the driver re-reads.
Co-Authored-By: Claude <noreply@anthropic.com>
The id is allocated before the ask and travels in StartDeployment, so a timed-out
caller can name and poll the deployment that may still go ahead. REST answers 202
OutcomeUnknown with a Location; the AdminUI shows 'could not be confirmed, may still
be created'; a retry during a running compose gets 409 naming the same id. The actor
logs per-phase timings for composes slower than 3 s.
ProjectedMonitoredItem remembers the acquisition its last SDK notification consumed (key only,
no value retained). A complete snapshot of that same acquisition, arriving while nothing else is
queued (no candidate, no queued loss, no reset since), renews health evidence but adds no
candidate: the node's value does not change, so the SDK never raises a notification to consume it,
and the candidate held its shared budget charge until the binding changed. Cleared on any queue
reset (rebind, loss, client mode change, unmatched notification), so a fail-safe miss only costs
an unproven notification + baseline request.
Red/green: A_redelivered_already_consumed_acquisition_leaves_no_orphan_candidate (red: 1 orphan).
#946: AlarmRefreshRequiredMinInterval (default 10 s, 0 disables) spaces RefreshRequired-triggered ConditionRefresh sweeps per session; a request inside the window is deferred to its end and coalesced, never dropped.
#947: AcknowledgeAsync throws the breaker-exempt DriverOperationRefusedException for Bad per-ack statuses and unresolvable condition ids (BadConditionBranchAlreadyAcked is success) so the #760 revert fires. Docs reverse the O-8 decision.
M1: a scripted method whose request deadline leaves < the dispatch floor, or that
follows an unanswered scripted method in the same Call, is refused BadTimeout in
its handler (unsent, unapplied); OpcUa:Quotas:MaxNodesPerMethodCall = 1000.
M2: ExecuteAlarmCommand carries the asker's deadline; an expired ask skips the
engine and is not remembered (the broadcast copy applies).
L1: revert guarded by a per-condition mutation counter; raw severity restored.
L5 + nits: docs, stale comment. SDK check: no Part 9 handler calls our delegate
before its own validation.
Co-Authored-By: Claude <noreply@anthropic.com>
1. A post-dispatch refusal now puts the node back to its captured pre-call state
with one corrective event (skipped when the node changed since) — the SDK had
already applied and reported the change. Blank scripted AddComment is refused
in the handler before the SDK runs.
2. ScriptedAlarmCommandDispatch: ask the local engine first, broadcast to the peer
only on Applied/OutcomeUnknown — a refusal now reached no engine anywhere.
3. ApplyAsync no longer checks 'loaded' before _evalGate: a command racing the
first load queues behind it; never loaded => refusal (nothing applied).
4. One Call's requests are settled sequentially (no request runs against a node
state the engine refused); <= 64 asks in flight node-wide, else
BadTooManyOperations before anything applies; per-request bound starts at send.
Measured 300 acks through one host + LocalDb: 59 ms sequential, max 24 ms/ask
with 64 outstanding.
5. Mixed-batch wire test (scripted refused + native + imported + scripted applied
+ core-manager method): per-item status in order, one scripted ask at a time.
L6: readiness from the engine's HasCompleteGeneration on a load fault.
L7: the verdict slot is closed when its SDK call returns (timer-captured
AsyncLocal can no longer park an ask). L10: remote budget never stretched.
Co-Authored-By: Claude <noreply@anthropic.com>
Native AddComment shares HandleAlarmCommand but is applied at the node only;
asking the scripted host made it BadInvalidState (live A02 on fu937-1).
Co-Authored-By: Claude <noreply@anthropic.com>