Networking & Hardware
Network Failure Handling & Resiliency
Handling unreachable edge routers, circuit dropouts, session reconciliation, and desync recovery.
Network Failure Handling & Resiliency
IMPLEMENTED
Physical carrier networks experience fiber cuts, upstream power outages, and temporary link flapping. Sheba ISP ERP guarantees system stability during hardware failures.
1. Non-Blocking I/O & Circuit Breakers
When communicating with a remote MikroTik or OLT:
- Strict Timeouts: Socket connections timeout after 5 seconds (
timeout=5.0). - Graceful Degradation: If an edge router is offline during customer creation, the customer record is safely saved in PostgreSQL with status
DESYNCrather than throwing an unhandled HTTP 500 error. - Circuit State Tracking: If 3 consecutive health checks fail, the router status is flagged
OFFLINEand alert notifications are broadcast to NOC staff.
2. Session Reconciliation Background Task
The Celery task sync_pppoe_sessions(router_id) runs periodically:
- Connects to the MikroTik router and pulls
/ppp/active/print. - Reconciles running sessions against the
UserSessiontable in PostgreSQL. - Removes orphaned session records for subscribers who disconnected abruptly without a RADIUS stop or FIN packet.
- Identifies unauthorized sessions running on the router that lack an active customer profile in the ERP.