Driver config edits are silently discarded on Modbus/FOCAS/OpcUaClient (deployment still seals green) #516
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?
Found while building the MTConnect driver (PR #506) and verified independently end-to-end against current
master. Deliberately not fixed there — out of scope for that plan.Symptom
An operator edits a Modbus / FOCAS / OpcUaClient driver's config and deploys. The driver keeps running the old config.
ApplyResult(true)is returned and the deployment seals green.Silent no-op — the worst shape, because it looks successful.
Cause
DriverInstanceActorassigns_driveronce (DriverInstanceActor.cs:307) and never rebuilds it from the factory. Both config-change paths therefore hand the new JSON to that already-constructed instance:HandleApplyDeltaAsync(L592) →_driver.ReinitializeAsync(msg.DriverConfigJson, …)AdoptConfigDuringInit→ the actor'sInitializeAsync(L554) →_driver.InitializeAsync(driverConfigJson, …)So
driverConfigJsonis the only channel by which a config change can reach a running driver.But these three never read that parameter — they use the ctor-injected
_optionsexclusively:ModbusDriver.InitializeAsync(L195)FocasDriver.InitializeAsync(L104)OpcUaClientDriver.InitializeAsync(L160)Their
ReinitializeAsyncdelegates toInitializeAsync, so the new config is dropped on the floor.Prior art in-tree
S7 does it correctly and documents why — see the comment at
S7Driver.cs:283. MTConnect follows S7, and this was confirmed live on the PR #506 gate: a corrected tag config took effect on redeploy with no container restart.Still to check
The per-driver survey was inconclusive for AbCip, TwinCAT and Galaxy — verify each one's
InitializeAsyncactually re-parses before closing this.Suggested fix
Make
InitializeAsyncre-parsedriverConfigJsonfollowing S7's pattern (an empty/blank body keeps the ctor options). Add a per-driver regression test: reinitialise with a changed config and assert the change is observable, not merely that the call returned true.