WebSocket Reconnect Behavior
This playbook explains how fyers-store reconnects to market and order WebSockets.
What Happened
- WS disconnects or errors appear in the logs.
- Data feed stalls (no new messages).
Why It Happens
- Network blips, FYERS maintenance, or auth invalidation.
- SDK-level reconnect limitations or throttling.
What To Check
logs/fyers_ws_errors.logfor disconnect reasons.config/fyers_ws.yamlreconnect and backoff settings.store.health_check()formarket_wsandorder_wsstatus.
What To Do Next
- Confirm the token is valid (run
fyers-authif unsure). - Restart the process if reconnect attempts are exhausted.
- Ensure subscriptions are re-applied after reconnect.
Safety Notes
- Reconnect backoff prevents reconnect storms that can trigger rate limits.
- Order WS reconnect triggers a REST reconcile before new messages are consumed.
Scenario Example
Scenario: WS reconnects repeatedly every few seconds. What happened: - The adapter is reconnecting with backoff but auth is invalid. What to check: - Auth error logs and token timestamp. What to do next: - Refresh the token, restart the process, and confirm stable connectivity.