Distributed Management and Failure Handling
Worker / Backend Registration
Registration information:
- worker_id
- backend_id
- host_id
- backend_type
- engine / runtime version
- adapter version
- protocol version
- capabilities
- resource capacity
- labels
- last_heartbeat
- generation
Leases
The ADR's current parameters serve as the initial candidates:
- Heartbeat: 1 second.
- TTL: 5 seconds.
- Lost contact after 3 consecutive misses.
These parameters need validation under network jitter and high load.
Lost-contact policy:
- Freeze new load.
- Do not actively disconnect existing connections.
- Record the lease invalidation time.
- Allow the Backend to keep existing sessions according to policy.
- After recovery, re-handshake and synchronize state.
- After the maximum lost-contact duration, follow the Swell's DrainPolicy.
- Events from an old generation are dropped or archived; they must not overwrite new state.
Failure Classification
- Controller lost.
- Worker lost.
- Supervisor crash.
- Engine Bot process crash.
- Bridge disconnected.
- Monitoring provider lost.
- Target server unavailable.
- Local resource exhaustion.
- Event queue overflow.
- Inconsistent plan data.
Every failure type must define detection, state, recovery actions, report impact, and whether automatic retry is allowed.