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

Query regarding HttpClient retry mechanism #26

Closed
robshep opened this issue Nov 21, 2014 · 2 comments
Closed

Query regarding HttpClient retry mechanism #26

robshep opened this issue Nov 21, 2014 · 2 comments

Comments

@robshep
Copy link
Contributor

robshep commented Nov 21, 2014

HttpClient has a retry mechanism.

Can I ask why the internal retry counter is incremented on every call to execute

https://github.com/kairosdb/kairosdb-client/blob/master/src/main/java/org/kairosdb/client/HttpClient.java#L85

After testing the client last night - I see that after a few thousand successful requests, when the server (on my laptop) went away (died), there were delays of more than 40 minutes between "exceptions"

when the server recovered some time later requests were successful again, but when it went away again, the retry mechanism was still causing delays of more than an hour.

Why the ++operator at line 85?
is it meant for some kind of exponential backoff?
what if it were reset to the initial value after a successful "1st attempt" submission instead of successful submissions altering the internal state every time?

happy to provide a patch for any of this.

@jsabin
Copy link
Contributor

jsabin commented Jul 29, 2015

Looks like a bug. I will take a look at it.

jsabin pushed a commit that referenced this issue Jul 30, 2015
… being incremented each time execute() was called. The intent was to increase the retry value once for each execution. So if retry is 3, it would be executed once and then retry 3 times.
@jsabin
Copy link
Contributor

jsabin commented Jul 30, 2015

Fixed in version #d59498fcb3bb7a527f3b644edd51fc089016efab.

@jsabin jsabin closed this as completed Jul 30, 2015
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

2 participants