Skip to content

Conversation

@philippose
Copy link

Hi,
After the discussion regarding retrying of failed kraken requests, I did a lot of reading up into the concept of making HTTP(S) requests more robust. This was also partly because I was getting very frustrated with the load related issues kraken was/has been facing over the last two months or so.

After scouring through different concepts, I found the one described on the following website to be quite elegant:
https://www.peterbe.com/plog/best-practice-with-retries-with-requests

Here is my implementation of the retry logic... Again, there is no "mandatory" change required to the currently existing API... and by default everything is disabled to preserve the present functionality as it is.

I have not been able to test this implementation on kraken because they seemed to have improved their service :-)

Could you kindly have a look at it and see if it is something you want to include into your wrapper?

Thanks, and wish you a wonderful new year :-)

Regards,
Philippose

@veox
Copy link
Owner

veox commented Jan 2, 2018

What is the benefit of doing it like this, compared to PR #65 or the retry-on-failure branch linked therein?..

The one small up-side I see is the use of backoff with an ever-increasing delay.

The article you linked sounds like @peterbe's code is intended to interface with arbitrary network services, that could have various misconfigurations or failure modes. We're just connecting to one here, api.kraken.com.

@philippose
Copy link
Author

philippose commented Jan 2, 2018 via email

@veox veox added this to the v2.x milestone Jan 3, 2018
@veox veox changed the title Enh requests retry 2 Alternative approach to retry failed queries Jan 3, 2018
@veox
Copy link
Owner

veox commented Aug 28, 2018

Much time has passed, and seems Kraken is experiencing high loads again - it's been brought up in issue #98.

After pondering a lot, I think you're right:

My attempt was to reduce the amount of "specialist" code in the krakenex API, be using available functionality.

PR #65 does take a somewhat NIH approach, which tends to become a rake eventually. :)

The configurability of delay periods on failure is also a plus - it might be sensible to make them non-linear in some cases.

I'll try to get to this at the closest opportunity.

@philippose
Copy link
Author

Hi,
I just went through my side of the code, merged your current master into the master of the fork, and merged the whole lot into my branch ENH_requests-retry-2.
So this should bring this branch, and consequently the pull request up to date with the current state of your code.

@veox
Copy link
Owner

veox commented Sep 12, 2018

I've pulled it in locally, did some clean-up, and am hoping to get to testing it on a live set-up.

There's still some clean-up that I need to do, hopefully will find time this week...

@veox
Copy link
Owner

veox commented Sep 12, 2018

Closing this - incorporated into PR #99.

@veox veox closed this Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants