-
Notifications
You must be signed in to change notification settings - Fork 233
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
Connection: Implement a mechanism to retry failed HTTP requests for certain status_codes #65
Conversation
On failure during peak use time, it is detrimental to resend the query without a "sleep" period. Also, the fact that this doesn't create duplicate orders must be estabilished. The default behaviour should be "no retries" IMO. It's also OK to call the object The status codes for which retries should be performed should be configurable. Delaying until post-release of |
I'm inclined to manually merge this into a feature-branch as-is, and then implementing the above notes; unless you have some commits not pushed to your github repo?.. |
@veox , hold on with this one. I've been testing it for a while and recently has got 2 cases where allegedly the same order was put twice (specifically when putting order i got a message "Insufficient funds", while I was able to see that order was successfuly created. I need to prove or refute the hypothesis that the message was generated by the second identical order as a result of query repeat) . Kraken was so unresponsive that time that it's not clear from logs whats exactly happened so i'm going to add some additional logging that will record NONCE passed with the query and let the group know back. |
The current load on Kraken is perfect for testing this code; I've gone ahead and worked it into branch In general, it seems to work fine for me, at least ATM. Regarding twin orders: do you have the "nonce window" setting changed? Did you acidentally add code Anecdotally, right now a |
Actually, opened a separate PR #100 that was based on this one, to compare approaches again... |
Fixes #66
During peak times large amount of http requests are failing without a specific response from Kraken server. These are intermittent problems with CloudFlare/Kraken and for some of returned http codes it should be safe to retry an operation.
Max number of retries is configurable via bad_http_connection_retries attribute. As each request has a unique nonce which is checked on a server, it should prevent execution of several identical requests if they get to a server despite a failed status_code.