fix(client): #1000 failover retries with backoff, reconnect clears the subscription map, subscriptions batch into one round trip
S-4: a failover that finds every endpoint down stays Reconnecting and cycles the endpoints with a 1s..15s capped backoff until it connects or the connection epoch moves on; the backoff is woken by the epoch so it never pins the failover slot. S-3: ConnectAsync/DisconnectAsync/landing Disconnected clear the recorded subscriptions, so a re-subscribe of the same node creates a monitored item. S-12: SubscribeManyAsync + ISubscriptionAdapter batch add (one CreateMonitoredItems), used by the CLI subscribe and the failover replay. CLI subscribe/alarms print connection transitions.
This commit is contained in:
@@ -69,6 +69,8 @@ those, the CLI fails loudly if the server advertises an endpoint with no or an u
|
||||
|
||||
When `-F` is provided, the shared service tries the primary URL first, then each failover URL in order. For long-running commands (`subscribe`, `alarms`), the service monitors the session via keep-alive and automatically reconnects to the next available server on failure.
|
||||
|
||||
If every endpoint is down when a failover starts (a restarting server, a redundant partner mid-switchover) the service stays in `Reconnecting` and cycles the endpoint list again with a capped backoff (1 s doubling to 15 s) until one connects or the user disconnects; it never gives up on its own (#1000). Both commands print `CONNECTION <old> -> <new> (<endpoint>)` lines for every transition, so a run across a restart shows the drop and the recovery. On recovery all recorded subscriptions are re-created in one batched request per sampling interval, and `subscribe` itself creates its monitored items for the whole target set (including `-r`) in one request instead of one round trip per node.
|
||||
|
||||
```bash
|
||||
otopcua-cli connect -u opc.tcp://localhost:4840/OtOpcUa -F opc.tcp://localhost:4841/OtOpcUa
|
||||
```
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ Connection settings are saved to `{LocalAppData}/OtOpcUaClient/settings.json` af
|
||||
|
||||
### Redundancy
|
||||
|
||||
When connected, the redundancy row displays the server's redundancy mode, service level, and application URI. The shared service handles automatic failover to backup endpoints if configured.
|
||||
When connected, the redundancy row displays the server's redundancy mode, service level, and application URI. The shared service handles automatic failover to backup endpoints if configured. If no endpoint is reachable it stays `Reconnecting` and keeps retrying with a capped backoff (1 s to 15 s) until the user disconnects (#1000).
|
||||
|
||||
## Browse Tree
|
||||
|
||||
|
||||
Reference in New Issue
Block a user