Skip to content
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

Get the HTTP response code for requests made? #382

Open
iepurasu opened this issue Oct 15, 2019 · 9 comments
Open

Get the HTTP response code for requests made? #382

iepurasu opened this issue Oct 15, 2019 · 9 comments

Comments

@iepurasu
Copy link

Hey there!

I'm trying to add some retry / error handling logic to the code that I'm writing.
I want to be able to split between errors that should be retried and ones that should not. I feel a good split is 4xx as non-retriable and 5xx as retriable.

Any way I could get this status over? The error messages that are contained in the API response in case or error are 1. not documented all in one place (that I could find) 2. make it hard to split them between such error types.

Please let me know if you have any suggestions, thanks!

@eraoul
Copy link

eraoul commented Oct 28, 2019

+1. I'm running into this because I get the "slow rate limit exceeded" error, which makes no sense since I'm already doing the required rate-limiting. The only solution is to retry when Coinbase decides to randomly do this extra rate-limiting beyond what is specified in their docs.

@noah222
Copy link

noah222 commented Oct 31, 2019

What specific kinds of requests are you making when getting throttled? If you are polling prices this is not good practice and will cause all sorts of problems with your trading strategy (due to the variable ping delay in responses). Since response codes are not revealed you simply use your own logic to decide what to do based on the contents of the message, and also in-case the response is blank.

@bfailing
Copy link

+1. I'm running into this because I get the "slow rate limit exceeded" error, which makes no sense since I'm already doing the required rate-limiting. The only solution is to retry when Coinbase decides to randomly do this extra rate-limiting beyond what is specified in their docs.

It gets worse. I emailed them about this back in early October and they responded: "We're not familiar with the slow rate limit message either, but very likely they are interchangeable. Can you please provide the full message?" So they are either incompetent or too lazy to look at their own code. Any information on this unspecified rate limit would be appreciated.

@noah222
Copy link

noah222 commented Nov 15, 2019

no one has explained the kind of requests they are making when getting the error

@eraoul
Copy link

eraoul commented Nov 15, 2019 via email

@noah222
Copy link

noah222 commented Nov 15, 2019 via email

@bfailing
Copy link

Also retrieving historical data. I looked into it a bit further and the error is triggered after ~1,000 requests at an average request/second rate of about 1.5. Reducing this to about 1.3 requests/second avoids the error when making about 2,000 requests. So 1 request per second is probably a safe bet.

@noah222
Copy link

noah222 commented Nov 16, 2019 via email

@mcardillo55
Copy link
Collaborator

The response code is not currently exposed by the API, but there is an open PR that will implement this #260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants