-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto pacing on 429 error #15
Comments
hey @exallon72 thanks for the suggestion 👍 Could you point out how this could be implemented? Would you see IBind keep an internal request counter and throttle requests upon seeing 429? How would you imagine such an interaction would look like from your app's perspective? |
It's a good question. First it should probably not allow any more requests to be done within the same session to that endpoint. Then I got a strange error. Tried with a couple of BTC. That I apparently do not have access to. It retiried 3 times. But then I got a 429. Indicating to me that it seems to loop a lot more than that since IB is usually not that picky. Unfortunately I don't have the log for the failed attempts left, but should be easy to replicate by using an asset you don't have market data access. Traceback (most recent call last): |
One small improvement could be also for the 429 not just send |
Adding to that. If you don't have market data access. It should not do any retries. This was using: |
After a 429?
What do you mean that 'it seems to loop a lot more'? There's a reattempt logic when encountering ReadTimeout error, but other than that not sure what kind of loop you're referring to here. Could you elaborate?
If this response was sent to you after only 3 attempts, I'd encourage you to talk to IBKR support about this and ask as to why it comes up this early.
Sorry, I'm not sure what you're suggesting here. Instead of ExternalBrokerError you'd see some other exception? The ExternalBrokerError has a
Does IBKR send some particular unique message when we don't have market data access? Then I guess yes, we could totally catch it and handle it gracefully 👍 |
What do you mean that 'it seems to loop a lot more'? There's a reattempt logic when encountering ReadTimeout error, but other than that not sure what kind of loop you're referring to here. Could you elaborate? I am also a bit confused I don't see that only three retries should generate a 429. You are right about the status_code 429. I am using that now. Thanks for pointing it out. I will get back to you with log of a request without market data access. |
It would be great if you could make the API auto pace itself on 429 errors.
The text was updated successfully, but these errors were encountered: