Frequent Disconnect and Reconnects on Kite API.

razcads
Hi @sujith
Since yesterday afternoon around 2:30 pm onwards i am seeing very frequent disconnect and reconnect of kite Ticker and its continuing today. The error captured today morning is below

Can you check and confirm if there is an issue with KiteTicker? I used to get these errors very rarely before maybe 2 or 3 times are day, but of late its too frequent. Do check and revert.
Thanks
Raz
  • sujith
    Have you implemented on_error callback? Can you see if there is any message?
    Have you made any recent changes?
    Is this only happening after subscribing to set of tokens or this is random?
  • razcads
    razcads edited September 2019
    I have on_error enabled and it is the one that's throwing 1006 connection error.
    I have indeed made a ton of changes.
    This is happening at random. I haven't had this issue for the past half hour though.
  • ZI4453
    peer drops usually occurs if your stream is clogged,please check if you are taking care of stream storage... this is apart from your router issues.
  • razcads
    Well this is setup in AWS. Wanted to know if there was an issue with Tickers at your end.. Looks like if there was you weren't aware of it.. OR maybe AWS was acting up. Anyway its not happening now.. so I am happy to let this go! Thanks!
  • sujith
    @razcads,
    I have added some explanation here, please do take a look at this.
  • razcads
    @sujith many thanks.. I didn't realize that the ticks get queued if processing takes long.. I was of the view that the nature of tickers is to fire and forget and not wait for ticks to be processed similar to what happens on MetaTrader systems. I will watch out for this though . Many Thanks.
  • sujith
    The queuing is at the client end and not at the server. The server just broadcasts messages and nothing else.
  • razcads
    razcads edited September 2019
    @sujith sorry but I just cant agree with what u are saying. It doesn't work like that at all. No queuing happens at client end atleast not in the way you seem to suggest. Anyway today the market has been extremely volatile and the same code as yesterday is running on my system on the same derivatives and not once have I got the 1006 error. Makes me suspect there was some issue with KiteTicker or my AWS connection yesterday.
  • ZI4453
    @razcads you are partially right, but when you open a socket connection to server it keeps broadcasting data from its end irrespective of consumer's status.Once you re establish your interrupted connection your client will be forced to consume all data(whatever was transmitted prior client goes missing) which was in transit...
  • sujith
    Hi @razcads,
    For many people, it happens like this. I am not sure about your case.

    I had come across this behavior a very long time back while working on javakiteconnect. Maybe it is the nv-websocket-client library behavior. I am not sure how the twisted library works. But in nv-websocket-client also the queue is not high, it just stores a couple of messages probably but there will be packet loss which means there can be missing ticks.
    May be in python, there is no queue and all messages are lost.
  • razcads
    yes atleast in twisted the messages will be lost if a tick is not processed before the next tick comes in.. maybe there is a queue of a few ticks not sure but ticks do get overwritten whenever a user function is busy. On connection re-establish what I have seen is just lose ticks again, maybe there is some cache at the server side or wherever that gets through old data if at all but most often the messages are just lost. One can leave with that as the disturbance is transient and in the scheme of things just dont matter. Been a good discussion. Thanks! :)
Sign In or Register to comment.