Phase 3 PR 74 -- OPC UA Client transparent reconnect via SessionReconnectHandler #73
Reference in New Issue
Block a user
Delete Branch "phase-3-pr74-opcua-client-session-reconnect"
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?
Summary
Before this PR a keep-alive failure flipped
HostStatetoStoppedand stayed there. Now the driver auto-retries via the SDK'sSessionReconnectHandler.OnKeepAliveon bad status spins up_reconnectHandler(lazy, single-instance) + callsBeginReconnectwithReconnectPeriod(default 5s).OnReconnectCompletereadshandler.Session, unwires keep-alive from the dead session, rewires to the new one (without this the next drop wouldn't trigger another reconnect), disposes the handler, flips back toRunning.Session.TransferSubscriptionsOnReconnect=true(SDK default) handles subscription migration automatically — localMonitoredItemhandles stay live across the bounce.ShutdownAsyncnow callsCancelReconnect()+ Dispose beforeSession.CloseAsyncto prevent the retry loop fighting the close.Validation
dotnet build: 0 errorsScope
Live disconnect-revive wire coverage deferred to the in-process-fixture PR.
Test plan
ReconnectPeriod= 5s