A pre-cancelled token throws before taking a slot, and the port delegate is dispatched with Task.Run(None) so its
finally always releases (a Task.Run on a cancelled token never runs the delegate).
In-process loopback h2c host: IConnectionLifetimeFeature.ConnectionClosed is exposed on the HTTP/2 stream context,
two requests on one connection share one session, and disposing the client connection clears it.
Remote reads hold at most N - max(1, N/4) of the node manager's N process-wide history batch slots
(MaxConcurrentHistoryReadBatches); past that a remote request is BadTooManyOperations unsent, so local OPC UA clients
always keep at least one slot.
Metadata no longer rebuilds the history view per node x operation (and checks the ACL before the tagname, the
ingress order); OriginHistoryPort caches its served-aggregate set per historian source instance.
Origin advertises history whenever it has a historian, so a not-ready/demoted endpoint answers HistoryRead
Unavailable (ungranted: PermissionDenied) and the consumer fails over like v1 Read instead of 'unsupported'.
Client: malformed/undecodable answers are endpoint failures (fresh read moves on); a resumed item is
ContinuationPointInvalid while a fresh item of the same batch is BadNoCommunication; a fresh read tries the next
endpoint when one lacks history; discovery backoff honoured; origin Cancelled without a caller cancel is BadTimeout
(no RecordFailure); caller cancel throws. The deployment lease maps inner/scope faults to BadNoCommunication.
The UnaryTimeout cap is documented next to the AdminUI field and in DataConnections.md.
Nodes are read in sub-batches sized to the response budget and no sub-batch starts once it is spent: the rest are
DEFERRED chunk tokens (transport; read on resume from their original continuation) or BadTooManyOperations (direct
consumer). Processed intervals and AtTime times above MaxHistoryValuesPerPage are refused unsent. Remainder bytes are
charged to a per-principal budget across sessions (concurrent reads x max(response budget, one page)); sizes come
from the encoded CalculateSize; a single value above the response budget is a per-item BadTooManyOperations.
Sessions are capped per principal (own LRU evicted first) and globally (the heaviest principal pays); a release never
creates a session; channel-close registrations are unregistered on clear.
DataConnectionScopeRevision covers consumer/connection/secret scope only; limits (TimeoutMilliseconds and now
HistoryTimeoutMilliseconds) reach DB-less nodes and the LocalDb cache in the artifact's entity JSON. Dropping the field
also avoids a one-time scope-version bump on upgrade. Plan 6 corrected.
Connection/export/mapping editors offer HistoryRead (DataOperationAuthoring, never ahead of the validator) and the
HistoryTimeoutMilliseconds / MaxConcurrentHistoryReads / MaxHistoryValuesPerPage / MaxHistoryResponseBytes /
MaxHistoryAssemblyBytesPerRequest fields; an informational banner shows while a post-v1 bit is ticked (plan 4.3).
GrpcDataConnection implements IDataHistoryService (explicitly; ReadHistoryAsync/ReleaseHistoryAsync avoid an overload
clash with ReadAsync): the capabilities probe always asks for history, other calls send it only when the selected
endpoint advertised it; per-call deadline min(remaining, HistoryTimeoutMilliseconds); FAILED_PRECONDITION/UNIMPLEMENTED
=> BadHistoryOperationUnsupported; chunks assembled within the request budget (BadTooManyOperations past it); page
tokens wrapped with the issuing endpoint + serving incarnation so a resumed read never moves; release forwarded. The
deployment lease gates history on the row's HistoryRead bit and carries HistoryTimeout. Decoded capabilities drop
HistoryRead without the history field. X0 tests that used bit 32 as the unknown bit now use a still-reserved bit.
Both recorded-v1-client gates now run against origins that grant HistoryRead, advertise history capabilities and
carry HistoryInfo; header-less bytes stay identical to the goldens (not re-recorded). GrpcDataHistoryWireTests: probe
shapes, FAILED_PRECONDITION without the feature, denied/unhistorized/unknown byte-identical with no backend call,
admission, cancel, wiring fault, chunking + lost chunk, release, direct runtime consumer. Endpoint allowlist gains
HistoryRead (the auth middleware rejected it).
Service: HistoryRead rpc; history (field 16, Metadata.history, bit 32) emitted only on a call whose header requested
history AND whose origin can serve it, otherwise stripped to the v1 shape; un-negotiated HistoryRead is
FAILED_PRECONDITION. Origin: Implemented(target) grows by HistoryRead when a historian backend is configured;
per-item gate catalog -> export grant + origin ACL HistoryRead -> tagname, every refusal the same
BadHistoryOperationUnsupported; per-principal admission (BadTooManyOperations), per-page ceiling, response-byte chunking
with single-use chunk tokens; one session per (principal, credential, HTTP/2 connection) cleared on close; wiring
faults BadInternalError + error log; caller cancel never a backend outcome. DataOperationPolicy maps HistoryRead.
Replays recorded v1 requests against the real DataConnectionGrpcService over the
real origin stack (LocalExportCatalog.Compile from a DraftSnapshot with Raw + UNS
exports, DataCapabilitiesProvider, PartitionedSampleHub, LocalDataServices,
DataWriteExecutor, LocalSubscriptionService/DataSubscriptionSession). Only the
physical driver write dispatch, upstream acquisition, transport and clock are
faked. Goldens captured on pre-H2 master 1086593a; nothing normalised.
Runtime gains InternalsVisibleTo Host.Tests for the Subscribe/Write seams.
Class added to the X0 manifest; X0.md section 2 records real vs faked,
determinism, the perturbation proof and the rule for H2/A2/A3.
Migration per plan 6 (HistoryTimeoutMilliseconds 30000; MaxConcurrentHistoryReads 4, MaxHistoryValuesPerPage
10000, MaxHistoryResponseBytes 4 MiB; MaxHistoryAssemblyBytesPerRequest 16 MiB) with non-null defaults and widened
check constraints. Validator known set grows by HistoryRead (mapping bits still subset of connection bits; history
limits positive); scope revision includes the history timeout.
OriginHistoryPort (public, implements IOriginHistoryPort) keeps SDK types inside OpcUaServer instead of an
InternalsVisibleTo: runs the synchronous ReadHistory off the caller's thread, one PeerHistoryContinuationScope per
request, absent bounds -> port MinValue, miswired scope surfaced as WiringFault. Exposed through the SDK sink so
DeferredOriginHistoryPort resolves it after server start; aggregate wire table pinned to AggregateFunctionMap.
HistoryRead rpc + HistoryCapabilities (16) / HistoryInfo (14) per plan 4.2; DataHistoryProtoMapper keeps the full
uint32 status, ns Timestamps, absent start/end/sample timestamps, verbatim aggregate configuration, and BadTypeMismatch
for a value kind disagreeing with the catalog. DataOperationSets.Understood gains HistoryRead; X0 tripwire replaced.
- a take computes its expectation only after consuming the record, so a
throwing incarnation source cannot leave a token replayable;
- a PeerHistoryContinuationScope is per request and reads the serving
incarnation once, so a request straddling a failover binds its next
token to the incarnation it started under (Save never answers null);
- a non-owner principal or a blank/throwing incarnation source raises
PeerHistoryContinuationWiringException, answered BadInternalError (not
BadHistoryOperationUnsupported); plan H2 note added;
- ConnectionIncarnation documented as identity only.
The realm folds mapped/raw into Raw (and every other index into Uns), so
(realm, identifier) alone could resume a raw node's cursor on the same
identifier in a mapped namespace. Items and cursor state now carry a
binding tag: the SDK adapter (and the events path) passes the node's
namespace URI, restoring the pre-port namespace-qualified binding; a peer
passes its view tag. The peer key binds it too.
The store used to build the expected key from its own fields, so the
principal/incarnation check could never fail. The scope now supplies the
caller's principal and reads the serving incarnation at save and at take, so
an in-process failover on a still-open connection invalidates its tokens; a
save for a non-owner principal is refused.
Raw/modified, Processed and AtTime serving (aggregate refusals incl. #897 and
SupportsAggregateFor, non-default AggregateConfiguration, modified+bounds
BadInvalidArgument, batch limiter, deadline, continuation binding, value
normalisation) now runs through OtOpcUaNodeManager.ReadHistory, addressed by
(realm, identifier) instead of SDK node handles. Continuation cursors are
re-keyed from the NodeId string to (realm, identifier). Adds the production
PeerHistoryContinuationStore (per principal + incarnation, random 16-byte
single-use tokens, 60 s idle expiry, oldest-idle eviction) for H2.
- ValidateDeployed ignores every bit outside Understood (understood subset still validated); P02's two
1<<30 rows become 'tolerated, grants nothing'.
- UnknownOperationDrops: Warning + counter tagged kind=connection|export|mapping, counted once per row per
accepted artifact change; collected under each lock, logged after release. Mappings masked at Stage.
- Surfaced via DataConnectionDiagnosticsSnapshot (DroppedUnknownOperations, MappingsWithDroppedOperations)
and NodeDiagnosticsSnapshot.DroppedExportOperations.
- End-to-end test: 1<<30 through parse -> catalog compile -> mapping stage -> runtime apply.
- DataConnectionProtoContract.Validate() now runs at AddOtOpcUaDataConnections.
P02 GrpcDataArtifactReadTests pins an arbitrary bit (1<<30) as a malformed row that fails closed; keep that and
tolerate only DataOperationSets.Reserved. P07 GrpcDataHotRouteContinuityTests reflects over the runtime constructor
shape, so the logger moves from a ctor parameter to an init property.
Covers the deployment runtime (plan site) plus two node-side validator passes the plan missed:
DeploymentArtifact data-row parse and LocalExportCatalog.Compile now use DataConnectionValidator.ValidateDeployed.
Authoring (Validate) still rejects the reserved bits.
/auth/login signed users in with an empty role set (and did so when the role
mapper threw), and AuthenticatedRead / the fallback policy admit any
authenticated user — with a domain-root SearchBase any AD user would get AdminUI
read access and a token.
- Empty mapped role set: refused like bad credentials (JSON 401; form redirect to
/login with a generic message), no cookie, Warning logged with the groups.
- Mapper throws: refused, fail closed (JSON 503 like an LDAP outage; form redirect
with a generic "temporarily unavailable"), exception logged.
- /auth/token: refuses (401) a cookie session carrying no role claim.
- Replaces Login_when_role_mapper_throws_signs_in_with_no_role_claims with refusal
tests (JSON + form), adds zero-role refused (JSON + form), one-mapped-role signs
in, zero-role cookie gets no token. JwtConfigurationGateTests' stub user now holds
a mapped group.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
- LdapOptions gains the four properties (library defaults) and ToLibraryOptions()
projects them; before this the AdminUI had no DC failover and the keys were
silently ignored.
- OtOpcUaLdapAuthService builds the library service with ILogger<LdapAuthService>
from DI, so failover Warnings, the sticky-preference line and stage diagnostics
reach the log.
- LdapOptionsValidator ports only the library's FallbackServers parse rule and the
BindMode=User -> UserBindTemplate {0}-exactly-once rule. ServiceAccountDn is NOT
required: DEV boots on the empty default (plan review B2).
- Fix stale comments: no direct-bind path exists; code default server is localhost.
- Tests: two-way reflection completeness guard over the library LdapOptions
(allow-list: ServerCertificateValidationCallback), JSON + env binding of the new
keys, validator rules, DEV-shaped boot, and a DI-built service against two closed
loopback ports proving library Warnings for primary AND fallback reach the log.
Claude-Session: https://claude.ai/code/session_01GT67AFKC45MBz1wPZnVbX8
PerEndpointConnectTimeout (3 s) now bounds only TCP + discovery, so failover past a
dead endpoint stays fast. The new SessionCreateTimeout (10 s) bounds OpenSecureChannel
+ CreateSession on an endpoint that answered discovery, where the client-side cert and
crypto work lives (#910). 2 x (3 + 10) s stays inside the host's 30 s initialise bound.
Expiries name the budget that ran out; both budgets must be positive; AdminUI form
carries the new field so a save does not drop it; driver docs updated.
Closes#912