fix(mtconnect): back off a /sample re-baseline that resolved nothing; scope Test Connect to the configured device
Driver.MTConnect-001 (Medium): StreamVerdict.Reopen reset the reconnect ladder
unconditionally. The InvalidDataException catch that routes an Agent OUT_OF_RANGE
to a /current re-baseline also catches an unparseable chunk and an over-sized
multipart part - neither of which a re-baseline can resolve - so the pump reopened
and failed with no delay at any point: two HTTP requests and one Warning per
iteration, forever. The Reopen arm now uses the same discriminator the transient
arm does (did THIS connection deliver a chunk?), so a buffer roll behind a working
stream still reopens instantly while a re-baseline that resolved nothing advances
BackoffFor.
Driver.MTConnect-002 (Medium): MTConnectDriverProbe requested {AgentUri}/probe
while MTConnectAgentClient requests {AgentUri}/{DeviceName}/probe, so a mistyped or
since-renamed deviceName showed GREEN on Test Connect and then Faulted the driver
at InitializeAsync (an unknown device path answers MTConnectError under HTTP 200).
The probe's minimal DTO now reads deviceName - the rule is 'which keys compose the
URL', not 'which keys are cheap to read'.
Driver.MTConnect-008 (Low): corrected two stale claims that a since-changed
RawBrowseCommitMapper invalidated (see Driver.MTConnect-003, which remains open and
belongs in AdminUI), and made DiscoverAsync log the options snapshot it
deliberately read once instead of the field.
Tests: 538 pass (534 base + 4 new, each red before its fix); AdminUI.Tests 1466 pass.
This commit is contained in:
@@ -16,19 +16,29 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.MTConnect;
|
||||
/// <b>Deliberately does NOT delegate to <see cref="MTConnectDriver.ParseOptions"/>.</b> That
|
||||
/// method builds the full driver options document, including every authored
|
||||
/// <c>MTConnectTagDefinition</c> (<c>BuildTag</c> can throw on a malformed tag entry that has
|
||||
/// nothing to do with reachability). A probe only needs <c>agentUri</c>, so this type parses
|
||||
/// its own minimal DTO — a config that is invalid for the driver (bad tag, bad data type) can
|
||||
/// still be reachability-tested, matching the AdminUI's "does the endpoint answer" intent for
|
||||
/// Test Connect. It also avoids a compile-time dependency on the factory DTO shape
|
||||
/// (<c>MTConnectDriverFactoryExtensions</c>), which is authored separately (Task 15).
|
||||
/// nothing to do with reachability). A probe needs only the fields that compose the request
|
||||
/// URL, so this type parses its own minimal DTO — a config that is invalid for the driver (bad
|
||||
/// tag, bad data type) can still be reachability-tested, matching the AdminUI's "does the
|
||||
/// endpoint answer" intent for Test Connect. It also avoids a compile-time dependency on the
|
||||
/// factory DTO shape (<c>MTConnectDriverFactoryExtensions</c>), which is authored separately
|
||||
/// (Task 15).
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Accepted gap: reachable ≠ deployable.</b> Because only <c>agentUri</c> is read, a
|
||||
/// config can show green on Test Connect and still fail to deploy — e.g. a non-positive
|
||||
/// <c>requestTimeoutMs</c> or a malformed tag entry the factory's full parse would reject.
|
||||
/// This is the direct consequence of the independent-parsing decision above, judged
|
||||
/// acceptable because Test Connect's job is "is the endpoint there", not "will this exact
|
||||
/// config deploy".
|
||||
/// <b>The minimal DTO is "everything in the URL", not "agentUri".</b> It reads
|
||||
/// <c>deviceName</c> too, because <see cref="MTConnectAgentClient"/> narrows every read to
|
||||
/// <c>{AgentUri}/{DeviceName}/probe</c>: probing the agent-wide path instead would answer a
|
||||
/// different question from the one the operator asked, and a mistyped or since-renamed device
|
||||
/// would show GREEN here and then Fault the driver at <c>InitializeAsync</c> (the Agent
|
||||
/// answers an unknown device path with an <c>MTConnectError</c> under HTTP 200). The
|
||||
/// distinction is not "which keys are cheap to read" but "which keys change the endpoint".
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Accepted gap: reachable ≠ deployable.</b> Because only the URL-composing fields are
|
||||
/// read, a config can show green on Test Connect and still fail to deploy — e.g. a
|
||||
/// non-positive <c>requestTimeoutMs</c> or a malformed tag entry the factory's full parse
|
||||
/// would reject. This is the direct consequence of the independent-parsing decision above,
|
||||
/// judged acceptable because Test Connect's job is "is the endpoint there", not "will this
|
||||
/// exact config deploy".
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Deliberately DOES reuse <see cref="MTConnectAgentClient"/> and
|
||||
@@ -117,6 +127,12 @@ public sealed class MTConnectDriverProbe : IDriverProbe
|
||||
private sealed class MTConnectProbeConfigDto
|
||||
{
|
||||
public string? AgentUri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The optional device scope. Read because it is part of the <b>URL</b>, not part of the
|
||||
/// driver's tag/timing configuration — see the "reachable ≠ deployable" remarks on the type.
|
||||
/// </summary>
|
||||
public string? DeviceName { get; set; }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -169,6 +185,11 @@ public sealed class MTConnectDriverProbe : IDriverProbe
|
||||
var options = new MTConnectDriverOptions
|
||||
{
|
||||
AgentUri = agentUri,
|
||||
|
||||
// Part of the request URL, so it must be carried: MTConnectAgentClient narrows every read
|
||||
// to {AgentUri}/{DeviceName}/probe, and a probe of the agent-wide path answers a different
|
||||
// question from the one the operator asked. See the type remarks.
|
||||
DeviceName = string.IsNullOrWhiteSpace(dto.DeviceName) ? null : dto.DeviceName.Trim(),
|
||||
RequestTimeoutMs = requestTimeoutMs,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user