dongjoon-hyun commented on code in PR #530:
URL:
https://github.com/apache/spark-kubernetes-operator/pull/530#discussion_r2891623019
##########
spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ReconcilerUtils.java:
##########
@@ -211,6 +221,16 @@ public static <T extends HasMetadata> void
deleteResourceIfExists(
}
}
+ private static boolean isTransientError(KubernetesClientException e) {
+ // code 0 is fabric8's sentinel for network-level failures (timeouts,
connection resets, etc.)
+ int code = e.getCode();
+ return code == 0
+ || code == HTTP_INTERNAL_ERROR
+ || code == HTTP_BAD_GATEWAY
+ || code == HTTP_UNAVAILABLE
+ || code == HTTP_GATEWAY_TIMEOUT;
Review Comment:
We had better use `switch` statement in this case. Something like the
following:
```java
return switch (e.getCode()) {
case 0, HTTP_INTERNAL_ERROR, HTTP_BAD_GATEWAY, HTTP_UNAVAILABLE,
HTTP_GATEWAY_TIMEOUT -> true;
default -> false;
};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]