gyfora commented on code in PR #394:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/394#discussion_r992133413
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconciler.java:
##########
@@ -272,6 +286,46 @@ private void recoverJmDeployment(
restoreJob(deployment, specToRecover, deployment.getStatus(), ctx,
observeConfig, true);
}
+ private boolean shouldRestartJobBecauseUnhealthy(
+ FlinkDeployment deployment, Configuration observeConfig) {
+ if (observeConfig.getBoolean(OPERATOR_CLUSTER_HEALTH_CHECK_ENABLED)) {
+ if (jobHealthChecker == null) {
+ jobHealthChecker = new
JobHealthChecker(Clock.systemDefaultZone());
+ }
+ } else {
+ if (jobHealthChecker != null) {
+ jobHealthChecker = null;
+ }
+ }
+
+ boolean result = false;
+
+ if (jobHealthChecker != null) {
+ final String clusterInfoKey = JobHealthInfo.class.getSimpleName();
+ if
(deployment.getStatus().getClusterInfo().containsKey(clusterInfoKey)) {
+ LOG.debug("Cluster info contains job health info");
+ if (!jobHealthChecker.isJobHealthy(
Review Comment:
I think there are all kinds of concurrency issues here. I think your code
assumes that there is one reconciler per resource, but the reconciler is used
concurrently from multiple thread.
--
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]