fix(focas): fail-fast at init on unimplemented backend (operator footgun)
Add IFocasClientFactory.EnsureUsable() — a config-time probe called by FocasDriver.InitializeAsync before any background loops start. The UnimplementedFocasClientFactory throws NotSupportedException immediately (faulting the driver at init), eliminating the footgun where a driver on the 'unimplemented' backend appeared Healthy then failed every read/write/ subscribe silently. WireFocasClientFactory and FakeFocasClientFactory are no-ops. Backstop Create() throw remains in place.
This commit is contained in:
@@ -89,6 +89,11 @@ public sealed class FocasDriver : IDriver, IReadable, IWritable, ITagDiscovery,
|
||||
Volatile.Write(ref _health, new DriverHealth(DriverState.Initializing, null, null));
|
||||
try
|
||||
{
|
||||
// Fail fast if the factory is a stub/unimplemented backend — the operator must
|
||||
// see an actionable error at init rather than a phantom-Healthy driver that fails
|
||||
// every read/write/subscribe silently (Driver.FOCAS-009).
|
||||
_clientFactory.EnsureUsable();
|
||||
|
||||
foreach (var device in _options.Devices)
|
||||
{
|
||||
var addr = FocasHostAddress.TryParse(device.HostAddress)
|
||||
|
||||
Reference in New Issue
Block a user