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/06/03 08:59:06 UTC

[GitHub] [flink-kubernetes-operator] gyfora commented on a diff in pull request #252: [FLINK-27889] fix: Catch the error when last reconciled spec is null

gyfora commented on code in PR #252:
URL: https://github.com/apache/flink-kubernetes-operator/pull/252#discussion_r888760743


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java:
##########
@@ -354,8 +355,54 @@ protected ClusterClient<String> getClusterClient(Configuration config) throws Ex
     }
 
     public void cancelJob(FlinkDeployment deployment, UpgradeMode upgradeMode) throws Exception {
-        var conf = configManager.getObserveConfig(deployment);
-        var deploymentStatus = deployment.getStatus();
+        Optional<String> savepointOpt = Optional.empty();
+
+        Configuration conf = null;
+        FlinkDeploymentStatus deploymentStatus = deployment.getStatus();
+        try {
+            conf = configManager.getObserveConfig(deployment);
+            savepointOpt = cancelJob(deployment, upgradeMode, conf, deploymentStatus);
+        } catch (LastReconciledSpecException e) {
+            LOG.warn("Last reconciled spec is null", e);

Review Comment:
   Why would we cancel the job if last reconciled spec is null? that means it was never deployed



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