fix(dcl): verify-endpoint probe logs through a real logger so first-time OPC UA app-cert creation is visible (#121)
The site's DataConnectionManagerActor handed VerifyEndpointAsync a NullLogger. A secured probe is usually what first creates a node's application certificate, so the creation Warning carrying the thumbprint every server must trust was silently discarded (found on the rig live gate). The actor takes an optional probe logger; the Host supplies one. Test pins creation logged once (Warning, thumbprint), not on reuse.
This commit is contained in:
@@ -33,6 +33,7 @@ public class DataConnectionManagerActor : ReceiveActor
|
||||
// UA connections. Needed by the verify-endpoint probe (VerifyEndpointCommand), which
|
||||
// builds an ApplicationConfiguration directly rather than through a connection actor.
|
||||
private readonly OpcUaGlobalOptions _opcUaGlobalOptions;
|
||||
private readonly Microsoft.Extensions.Logging.ILogger _probeLogger;
|
||||
private readonly Dictionary<string, IActorRef> _connectionActors = new();
|
||||
|
||||
// Children this manager has STOPPED (RemoveConnectionCommand) but whose Terminated has not
|
||||
@@ -56,13 +57,20 @@ public class DataConnectionManagerActor : ReceiveActor
|
||||
/// verify-endpoint probe; null falls back to defaults (mirrors
|
||||
/// <see cref="DataConnectionFactory"/>'s default-options constructor).
|
||||
/// </param>
|
||||
/// <param name="probeLogger">
|
||||
/// Logger for the verify-endpoint probe; null discards. Gitea #121: a secured probe is
|
||||
/// usually what first creates the node's OPC UA application certificate, and that
|
||||
/// creation's Warning (with the thumbprint every server must trust) must reach the node log.
|
||||
/// </param>
|
||||
public DataConnectionManagerActor(
|
||||
IDataConnectionFactory factory,
|
||||
DataConnectionOptions options,
|
||||
ISiteHealthCollector healthCollector,
|
||||
ISiteEventLogger? siteEventLogger = null,
|
||||
OpcUaGlobalOptions? opcUaGlobalOptions = null)
|
||||
OpcUaGlobalOptions? opcUaGlobalOptions = null,
|
||||
Microsoft.Extensions.Logging.ILogger? probeLogger = null)
|
||||
{
|
||||
_probeLogger = probeLogger ?? NullLogger.Instance;
|
||||
_factory = factory;
|
||||
_options = options;
|
||||
_healthCollector = healthCollector;
|
||||
@@ -403,9 +411,8 @@ public class DataConnectionManagerActor : ReceiveActor
|
||||
return;
|
||||
}
|
||||
|
||||
var probeLogger = NullLogger.Instance;
|
||||
RealOpcUaClient
|
||||
.VerifyEndpointAsync(config, _opcUaGlobalOptions, probeLogger, TimeSpan.FromSeconds(6), CancellationToken.None)
|
||||
.VerifyEndpointAsync(config, _opcUaGlobalOptions, _probeLogger, TimeSpan.FromSeconds(6), CancellationToken.None)
|
||||
.PipeTo(Sender);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user