It looks like you're new here. If you want to get involved, click one of these buttons!
0-186/550
1-205/550
3-207/550
2-195/550
5-184/550
4-178/550
6-193/550
7-193/550
8-208/550
9-182/550
10-195/549
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/base.py", line 1242, in run
self.startRunning(installSignalHandlers=installSignalHandlers)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/base.py", line 1222, in startRunning
ReactorBase.startRunning(self)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/base.py", line 728, in startRunning
raise error.ReactorAlreadyRunning()
twisted.internet.error.ReactorAlreadyRunning
To reproduce this, create a new thread which creates a threaded KiteSocket. Make 2 such instances of Thread.
This problem can be handled. In zerodha's kiteconnect.ticker module, there is connect mothod in class KiteTicker. At the end, there are the following lines: reactor should be run only once in the process. So create a subclass of KiteTicker, override connect method to remove this block . And, in you application, run this block only once after you have spawned all the threads listening to the websocket. The reactor object can be imported using the following (same as in kiteconenct.ticker)
from twisted.internet import reactor
Hopefully, this error will be taken care of, but you will likely get another error. One thread will run fine, but you will get following error in other threads: I have started a new discussion with these issues, it is waiting to be approved by Zerodha before it appears on the forum.
Good luck and let us know if you are successful. Facing similar issues here.
Regards
Is the following error related to 429:
ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionAborted'>: Connection was aborted locally, using.].
2. When more than 500 instruments are subscribed the message length exceed the maximum length set by server so it closes connection with 1009 error.
3. More than once connection can't be created since its rate limited.
For now I would suggest you guys to run KiteTicker in main thread or different thread as given here and subscribe to instruments in batch. Instead of subscribing more than 500 at once subscribe multiple times (though max 1000 instruments are allowed).
Since its announced that 1000 instruments are supported I will check backend team about that.
1. Looks alright.
2. Your team need to sort that max length setting. It is configurable. Further, can you advise how to subscribe in batches? Please share sample code. Why advertise a functionality which is not usable.
3. I thought we are allowed to run three connections and there was no rate limitation on websocket. There is a confusion here. What was declared is that three connections are supported and there is no rate limitation. Now, in Kite3, if there is only one connection allowed and/or there is rate limitation, please make a proper announcement, insert in changelog, explain to users how it affects them, then allow them to migrate and not let it slip like this. It breaks user codes and like you, we also struggle when some vendor abruptly changes things especially the breaking ones. Where is the mention of this in your changelog.
Further, I was able to establish multiple connections till about yesterday noon, after that I have started facing problems.
Regards
Saurav
2. We have increased the limit for now but while announcing migration deadlines we will specify the rate limits for this as well.
The problems have been fixed for now. In case there is any change in rate limits etc ,please announce well in advance and allow users to adjust/migrate.
Regards
Saurav