-
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
Add Retry logic in createOrReplace when 500 received from ApiServer: Workaround for #2292 #2501
Conversation
Can one of the admins verify this patch? |
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage The version of Java (1.8.0_265) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11. |
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/BaseOperation.java
Outdated
Show resolved
Hide resolved
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/BaseOperation.java
Outdated
Show resolved
Hide resolved
Similar methods can also be found in: Line 134 in aa651fa
Line 256 in c65b454
The issue should be tackled there too. Maybe we can extract the logic to some helper or utils class (maybe in the scope of another issue > future). |
@FWiesner : Are you still working on this? I understand you might be busy with your release. If so, we can pick this up and get this merged before the upcoming release. |
Hi @rohanKanojia it would be great if you could pick it up - release is over, but I'm still under water and ill on top |
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java
Show resolved
Hide resolved
a1507ae
to
8feda92
Compare
51bd2dc
to
57838a0
Compare
@@ -471,4 +473,11 @@ public static String getSystemPathVariable() { | |||
private static String getOperatingSystemFromSystemProperty() { | |||
return System.getProperty(OS_NAME); | |||
} | |||
|
|||
public static boolean isHttpStatusCodeFromErrorEncounteredByServer(int code) { |
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.
Since this is not checking if the HTTP status code belongs to a server error family (code >= 500
), and for our use-case we just want to retry if one of these status codes is returned by the server, it's probably a good idea to move the method to CreateOrReplaceHelper
class.
Maybe also rename it to shouldRetry
or something like that, which suggests that the procedure is only retried for some specific status codes.
310c87c
to
cfd4be1
Compare
kubernetes-itests/src/test/java/io/fabric8/kubernetes/CreateOrReplaceIT.java
Outdated
Show resolved
Hide resolved
cfd4be1
to
bb0f2f6
Compare
+ Moved createOrReplace logic to CreateOrReplaceHelper class + Added tests
bb0f2f6
to
2aaa79b
Compare
SonarCloud Quality Gate failed. 0 Bugs 57.3% Coverage The version of Java (1.8.0_272) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11. |
[merge] |
awesome - thanks! |
[merge] |
Pull request is not mergeable. |
test, version modification, documentation, etc.)
Checklist