SDK 2 retries LDS RegisterServer against its own endpoint forever (log noise since #874) #876
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen on wonder-app-vd03 after the 2026-11-12 upgrade to
5fb4b4db:The pairs back off (2 s, 6 s, 12 s, 20 s…).
OpcUaApplicationHostbuildsServerConfigurationwithout touchingMaxRegistrationInterval/RegistrationEndpoint, so the SDK default registers with an LDS atopc.tcp://localhost:4840, which is this server itself (no LDS). It was silent before #874 routed SDK warnings to Serilog.Proposal: set
MaxRegistrationInterval = 0unless an explicitOpcUa:DiscoveryServerUrl-style option is configured, and add a test asserting the builtServerConfigurationdoes not register by default.https://claude.ai/code/session_01GT67AD99zQQqpLCVm3p7xk
Fixed on
masterinf127f454(fast-forward, pushed).Root cause (confirmed in decompiled SDK 2.0.1 source):
ServerConfiguration.MaxRegistrationIntervaldefaults to30000.StandardServer.StartApplicationAsyncarms its registration timer only whenMaxRegistrationInterval > 0, and with a nullRegistrationEndpointit targetsUtils.DiscoveryUrls[0]=opc.tcp://localhost:4840, SignAndEncrypt/Basic256Sha256. On a node that listens on 4840 itself, that is the server itself.Change:
OpcUaApplicationHost.ApplyDiscoveryRegistrationruns inBuildConfigurationAsync. By default it setsMaxRegistrationInterval = 0andRegistrationEndpoint = null, so there is no registration and no timer.OpcUa:DiscoveryServerUrl(default unset). When set, the server registers against this URL, using SignAndEncrypt/Basic256Sha256 like the SDK's own default endpoint.OpcUa:DiscoveryRegistrationIntervalMs(default 30000).OpcUaApplicationHostOptionsValidator: when a URL is set, it must be an absoluteopc.tcp://URL and the interval must be greater than 0.docs/Configuration.md(OpcUa table) anddocs/OpcUaServer.md(new "Discovery-server registration" section).ApplicationConfigPathXML path, where the XML's own registration settings still apply.Evidence:
OpcUaServer.Tests: 1264 passed, 1 skipped.Host.Tests: 288 passed. Validator tests: 21 passed, including a new 6-case theory.OpcUaApplicationHostDiscoveryRegistrationTests:ServerConfigurationand the startedStandardServer.m_registrationTimer. The timer is null by default and non-null when a URL is configured (positive control).ApplyDiscoveryRegistrationcall removed,Started_host_with_default_options_does_not_registerfails (MaxRegistrationIntervalis 30000, not 0).ServerSdkTelemetryforwarding.CLIENTCHANNEL CONNECT FAILED via opc.tcp://localhost:4840/OtOpcUaerrors on the 2/4/8 s backoff. Locally, 4840 belongs to another OPC UA container, so the reverted run failed at the secure channel rather than withBadServiceUnsupported; it was the same registration loop.Not deployed. vd03 picks this up on its next OtOpcUa upgrade.