You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/15 02:50:30 UTC

[GitHub] [flink-kubernetes-operator] tweise commented on a diff in pull request #165: [FLINK-26140] Support rollback strategies

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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org