tweise commented on code in PR #165:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/165#discussion_r851023715


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/deployment/ApplicationObserver.java:
##########
@@ -70,23 +70,28 @@ protected Optional<String> updateJobStatus(
     }
 
     @Override
-    public void observeIfClusterReady(
-            FlinkDeployment flinkApp, Context context, Configuration 
lastValidatedConfig) {
+    protected boolean observeFlinkCluster(
+            FlinkDeployment flinkApp, Context context, Configuration 
deployedConfig) {
+
+        JobStatus jobStatus = flinkApp.getStatus().getJobStatus();
+
         boolean jobFound =
                 jobStatusObserver.observe(
-                        flinkApp.getStatus().getJobStatus(),
-                        lastValidatedConfig,
-                        new ApplicationObserverContext(flinkApp, context, 
lastValidatedConfig));
+                        jobStatus,
+                        deployedConfig,
+                        new ApplicationObserverContext(flinkApp, context, 
deployedConfig));
         if (jobFound) {
             savepointObserver
-                    .observe(
-                            
flinkApp.getStatus().getJobStatus().getSavepointInfo(),
-                            flinkApp.getStatus().getJobStatus().getJobId(),
-                            lastValidatedConfig)
+                    .observe(jobStatus.getSavepointInfo(), 
jobStatus.getJobId(), deployedConfig)
                     .ifPresent(
                             error ->
                                     
ReconciliationUtils.updateForReconciliationError(
                                             flinkApp, error));
         }
+        return isJobReady(jobStatus);
+    }
+
+    private boolean isJobReady(JobStatus jobStatus) {
+        return 
org.apache.flink.api.common.JobStatus.RUNNING.name().equals(jobStatus.getState());

Review Comment:
   Can we add a TODO here? RUNNING doesn't mean that the job is executing as 
expected, even a job that flip flops may intermittently have RUNNING status.



-- 
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]

Reply via email to