Today 24-Nov-22 Websocket was frequently disconnecting?

dknaix
dknaix edited November 2022 in Python client
Like everyday had subscribed to instruments, since one api keys works for 2 WS connections i have 2 apps using 1 WS each, although re-connection code is written but today it is disconnecting very frequently compared to rest days (6-7 times from 9am to 11am).
Also Do threaded WS connection dont get killed at day end as the access_token gets expired? wanted to know as i doubt they are interfering please help
  • rakeshr
    disconnecting very frequently compared to rest days (6-7 times from 9am to 11am).
    What was the disconnection reason? Maybe paste couple of logs of the disconnection period.
    Also Do threaded WS connection not get killed at day end as the access_token gets expired?
    We don't kill the websocket connection forcefully, but re-auth happens around 07:30AM every day that filters out all invalid token connections, and those socket channel is not more established with the ticker.
    wanted to know as i doubt they are interfering
    Maybe you can log this at your end and see the behaviour.
  • dknaix
    Error Message: "Socket Error 1006 connection was closed uncleanly"

    my current Thread structure:
    Main
    ->worker Thread (non daemon,dies after work done)
    -> kws (threaded=True) # dont know about this, if it keeps ws open forever
    Main Thread die (after creating thread)

    Currently I dont use ws.close() every day at 3.30, i directly kill the child thread, i am doubting the WS connection is stacking.

    As you said "re-auth happens around 07:30AM every day that filters out all invalid token connections", what might had gone wrong as i haven't changed a line of code i am worried as it takes 0-3 seconds to reconnect
  • dknaix
    @rakeshr today also same websocket issue please check maybe the issue is from zerodha, have tested all combinations but same results, frequent websocket disconnection every 3-4 mins getting worse please look into the matter asap
  • Guhan
    @rakeshr facing the same issue today. Below is the error.

    Connection error: 1006 - connection was closed uncleanly (None)
    Connection closed: 1006 - connection was closed uncleanly (None)

    It has been months since I changed the code, this is the first time I am facing a disconnection, also my algo is hosted in AWS.
  • rakeshr
    @dknaix @Guhan
    We checked the logs, and don't see any major disconnection drop. We are evaluating more on this, meanwhile do let us know if you are seeing any specific disconnection pattern here.
  • dknaix
    monitoring from past 2 days haven't found any disconnection logs yet so i think socket is smooth now, but im sure the issue was from Zerodha side maybe more load or something. @rakeshr You can close this discussion now Thanks.
This discussion has been closed.