-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Retry HTTP for status >= 500 (exponential backoff) #3164
Conversation
Can one of the admins verify this patch? |
I think the code looks good, a general question would be around the existing backoff strategy in Line 127 in df5d802
Should there be consistency between the properties / strategy? Watch only uses interval and limit. There's also a hardcoded value of 5 limiting the exponential scaling to 32x. |
@shawkins |
...t/src/main/java/io/fabric8/kubernetes/client/utils/ExponentialBackoffIntervalCalculator.java
Show resolved
Hide resolved
I have renamed the properties to follow the existing naming used at watchers:
And extracted the interval calculation into This new class is not tested separately as the functionality is already tested by the existing watcher's unit test and it's logic is lightweight: The force-push was done because of the rebase on the top of |
I think the integration test failure is unrelated, probably a flaky test:
|
I looked around and found this: So this error was a known problem before which was tried to resolved by #3148 My changes are on the top of the current HEAD so I have these commit: |
Big thanks for the rerun to anybody who helped me! :) |
Yes that is the same issue an edit is just a different from of patch(item). That test should be updated to remove the possibility of a 422. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Marc Nuri <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
Kudos, SonarCloud Quality Gate passed! |
Cool feature! I have a question, do these new properties come into play when a |
@attilapiros @shawkins @manusa : Could you please share your thoughts on this? |
Yes, it will just throw the IOExeption.
Yes, that's an assumption made in other places, like with informers https://github.com/kubernetes/client-go/blob/master/tools/cache/reflector.go#L416 FWIW the code in fabric8 is a little different for watches/informers wrt connection refused - if the initial watch/list (which would be subject to the common retry logic) succeeds, then any later IOExceptions will be assumed to be recoverable - indefinitely in the case of informers. |
Thanks for the information. Should I open a new issue for this feature request? |
Yes please. |
Sorry I am away from my computer but next week latest I can check it |
#3291 is the new issue |
Description
Fix #3087
This PR introduces configurable retry with exponential backoff for HTTP operations.
As according to the API conventions when the HTTP status code is one of the followings:
Then the suggested client recovery behavior is "retry with exponential backoff".
Although in case of 504 it is "Increase the value of the timeout param and retry with exponential backoff" but in this PR I would only focus on the retries. That can be implemented in a follow up PR.
For the intention behind please check: #3087.
Type of change
test, version modification, documentation, etc.)
Checklist