Delete the dead in-place ApplyDelta seam (config change = respawn only) #665
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?
Follow-up to #663 / #664.
Problem. The in-place config path (host
ApplyChildDelta→DriverInstanceActor.ApplyDelta→ReinitializeAsync, orAdoptConfigDuringInitmid-connect) has had no producer since #516: a DriverConfig change is stop + respawn, andDriverSpawnPlan.ToApplyDeltais always empty (pinned byDriverSpawnPlannerTests). #663 and #664 were both latent bugs in this dead code. Its remaining known gaps are also unreachable: a refused Galaxy change acks success on adoption, and Galaxy RawTags changes are not compared.Change. Delete the seam so that a config change has exactly one path, the respawn:
ApplyChildDelta,_pendingDelta,HandleApplyResultand theDeltaAppliedhandling.DriverSpawnPlan.ToApplyDelta.ApplyDelta,ApplyResultandDeltaAppliedmessages,HandleApplyDeltaAsync,AdoptConfigDuringInit, and the adoption-notify flag.IDriver.ReinitializeAsyncand each driver's implementation and unit tests stay: it is an interface member, and removing it is a separate, larger decision.Done on master in
88ef1ea9(merging1ea1da82): 33 files, +112 / −559.Deleted
ApplyChildDelta,_pendingDelta,HandleApplyResult,HandleDeltaApplied, and theirReceiveregistrations in all three states.DriverSpawnPlan.ToApplyDelta. The record is now(ToSpawn, ToStop), so an in-place path can no longer be added without a compile-visible change.ApplyDelta/ApplyResult/DeltaAppliedrecords, the Stubbed/Connecting/Reconnecting/Connected handlers,HandleApplyDeltaAsync,ReleaseAlarmSubscriptionAsync,AdoptConfigDuringInit, and the #664 notify flag.DriverInstanceActorTests, the two-case #663 theory), the #663 stub additions, and the tenToApplyDelta.ShouldBeEmpty()lines inDriverSpawnPlannerTests. The record no longer has the member, so those asserts are moot.Kept
IDriver.ReinitializeAsync, each driver's implementation, and their unit tests. The interface doc now says the runtime does not call it.InitializeAsynchonest to theIDrivercontract.AdoptConfigDuringInitwere rewritten to cite that instead.Coverage lost:
ApplyDelta_supersedes_in_flight_init_so_stale_result_is_ignoredwas the only test of the generation guard, and it drove the guard through ApplyDelta. The guard itself is unchanged.Verification: full suite on the merged master: 13213 passed, 0 failed (exactly −6 from the deleted tests).
Docs:
docs/DriverLifecycle.md,docs/IncrementalSync.md,docs/drivers/Mqtt.md,docs/v2/Runtime.md,CLAUDE.md. The scadaproj history entry isc713925. No behaviour change; ScadaBridge impact is none.