[Server] Add live NodeManager lifecycle support#4015
Closed
marcschier wants to merge 13 commits into
Closed
Conversation
marcschier
force-pushed
the
copilot/3993-live-node-manager-lifecycle
branch
from
July 18, 2026 13:33
6f48473 to
a2f1ee8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class, supported runtime lifecycle operations for server NodeManagers (add/reload/remove) and integrates them with request tracking, session/subscription safety, continuation points, and runtime NodeSet + complex-type refresh paths.
Changes:
- Introduces
INodeManagerLifecycleplus supporting host/registration/routing infrastructure to safely publish, replace, and retire NodeManagers at runtime. - Coordinates live mutations with request execution, session closing, subscription deletion, monitored-item ownership checks, and continuation-point invalidation.
- Expands runtime NodeSet support (including live reload/remove) and updates tests + docs to cover the new behavior.
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Opc.Ua.Types.Tests/Nodes/TypeTableTests.cs | Adds coverage for TypeTable subtype reparenting behavior. |
| tests/Opc.Ua.Server.Tests/SubscriptionTests.cs | Adds lifecycle-focused subscription tests (session closing / deletion / ownership). |
| tests/Opc.Ua.Server.Tests/RuntimeNodeSet/RuntimeNodeSetTestServer.cs | Exposes NodeSet test stream helper for wider test reuse. |
| tests/Opc.Ua.Server.Tests/RequestManagerTests.cs | Adds tests for request snapshot draining semantics. |
| tests/Opc.Ua.Server.Tests/NodeManager/NodeManagerRoutingTableTests.cs | New concurrency/snapshot tests for copy-on-write routing table. |
| tests/Opc.Ua.Server.Tests/Hosting/OpcUaServerHostedServiceCoverageTests.cs | Updates coverage tests for hosted lifecycle dependency. |
| tests/Opc.Ua.Aot.Tests/HostingAotTests.cs | Ensures INodeManagerLifecycle resolves in AOT scenarios. |
| src/Opc.Ua.Types/Nodes/TypeTable.cs | Fixes subtype reparenting + encoding bookkeeping when updating entries. |
| src/Opc.Ua.Server/Subscription/SubscriptionManager.cs | Adds deletion/closing coordination to support safe live NodeManager mutations. |
| src/Opc.Ua.Server/Subscription/Subscription.cs | Adds monitored-item ownership tracking and mutation coordination hooks. |
| src/Opc.Ua.Server/Subscription/ISubscriptionDeletionRegistry.cs | New internal contract for “subscription is deleting” checks. |
| src/Opc.Ua.Server/Session/SessionContinuationPoints.cs | Adds targeted continuation-point invalidation for a NodeManager. |
| src/Opc.Ua.Server/Session/Session.cs | Implements continuation-point invalidation hook for lifecycle. |
| src/Opc.Ua.Server/Session/ISessionClosingRegistry.cs | New internal contract to reject work during session closing. |
| src/Opc.Ua.Server/Server/StandardServer.cs | Wires lifecycle provider + request scoping + complex-type refresh path. |
| src/Opc.Ua.Server/Server/ServerInternalData.cs | Tracks closing sessions and exposes registry to other components. |
| src/Opc.Ua.Server/Server/RequestManager.cs | Adds validation/request scopes and snapshot draining for safe teardown. |
| src/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetNodeManager.cs | Adds reload participation and reference retention for runtime NodeSets. |
| src/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetLifecycleExtensions.cs | Adds convenience lifecycle extensions for runtime NodeSets. |
| src/Opc.Ua.Server/NugetREADME.md | Documents live add/reload/remove usage via lifecycle API. |
| src/Opc.Ua.Server/NodeManager/MasterNodeManager.cs | Implements dynamic NodeManager hosting + mutation coordination. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/NodeManagerRoutingTable.cs | New copy-on-write routing + visibility snapshots for manager dispatch. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/NodeManagerRegistration.cs | Adds generation-aware registration handle type. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/INodeManagerReloadParticipant.cs | Defines reload participant contract for safe replacement. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/INodeManagerMutationCoordinator.cs | Adds coordinator interface for mutation serialization. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/INodeManagerMonitoredItemTracker.cs | Adds contract to detect monitored-item ownership by manager. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/INodeManagerLifecycle.cs | Public API for add/reload/remove + registration snapshot. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/INodeManagerContinuationPointTracker.cs | Adds contract to invalidate manager-owned continuation points. |
| src/Opc.Ua.Server/NodeManager/Lifecycle/IDynamicNodeManagerHost.cs | Internal host contract for staged prepare/commit/rollback lifecycle. |
| src/Opc.Ua.Server/NodeManager/CustomNodeManager.cs | Improves teardown bookkeeping (type ownership, external refs, events). |
| src/Opc.Ua.Server/NodeManager/AsyncCustomNodeManager.cs | Async counterpart teardown bookkeeping improvements. |
| src/Opc.Ua.Server/Hosting/OpcUaServerHostedService.cs | Attaches/detaches hosted lifecycle to server instance. |
| src/Opc.Ua.Server/Hosting/OpcUaServerBuilderExtensions.cs | Registers hosted lifecycle provider in DI. |
| src/Opc.Ua.Server/Hosting/HostedNodeManagerLifecycle.cs | Adds DI-facing forwarding lifecycle implementation. |
| src/Opc.Ua.Server/ComplexTypes/ServerComplexTypeSystem.cs | Adds “additional NodeManager” complex-type load path for pre-publish. |
| src/Opc.Ua.Server/ComplexTypes/AddressSpaceComplexTypeResolver.cs | Allows resolving types from a prepared (not-yet-published) manager. |
| docs/SourceGeneratedNodeManagers.md | Updates runtime NodeSet guidance to include live lifecycle. |
| docs/RuntimeNodeSets.md | Documents live lifecycle semantics and APIs for runtime NodeSets. |
| docs/DependencyInjection.md | Documents INodeManagerLifecycle DI surface and usage. |
| docs/ComplexTypes.md | Updates complex-type documentation for live lifecycle behavior. |
marcschier
force-pushed
the
copilot/3993-live-node-manager-lifecycle
branch
from
July 19, 2026 21:39
a2f1ee8 to
2afe352
Compare
marcschier
marked this pull request as ready for review
July 21, 2026 09:17
…ode-manager-lifecycle # Conflicts: # src/Opc.Ua.Server/NodeManager/AsyncCustomNodeManager.cs
…ode-manager-lifecycle # Conflicts: # src/Opc.Ua.Server/NodeManager/MasterNodeManager.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 29378426-2a98-41ee-9a6d-050af5b1141f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 29378426-2a98-41ee-9a6d-050af5b1141f
7 tasks
Collaborator
Author
|
Superseded by #4094 after migrating the head branch into the OPCFoundation upstream repository. The upstream branch is commit-for-commit and tree-identical to this PR head at \�177a094ef. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds supported live add, reload, and remove lifecycle operations for NodeManager instances on a running server.
The change introduces a DI-backed
INodeManagerLifecycleservice with directStandardServeraccess, generation-aware registration handles, copy-on-write routing, transactional prepare/commit/rollback, runtime NodeSet convenience APIs, append-only namespace updates, model and semantic change notifications, additive-compatible complex type priming, and complete teardown behavior.Lifecycle publication is coordinated with requests, sessions, subscriptions, monitored items, continuation points, and shutdown so retired managers cannot remain reachable or be disposed while still in use. Compatible monitored items transfer to replacement generations without a transient bad status. Removed or incompatible Nodes publish
BadNodeIdUnknownas required by OPC UA Part 4 §5.8.4.1, retain their MonitoredItem identity, and automatically recover when a compatible Node with the same NodeId returns.Validation
Opc.Ua.Server.Testson net10.0: 3,666 passed, 5 skipped.Related Issues
Checklist
UA.slnxsolution against at least .NET Framework and .NET 10, and all passed.