rgsriram commented on code in PR #438:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/438#discussion_r1027268059


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkService.java:
##########
@@ -362,11 +362,21 @@ public void cancelSessionJob(
             FlinkSessionJob sessionJob, UpgradeMode upgradeMode, Configuration 
conf)
             throws Exception {
 
-        var jobStatus = sessionJob.getStatus().getJobStatus();
+        var sessionJobStatus = sessionJob.getStatus();
+        var jobStatus = sessionJobStatus.getJobStatus();
         var jobIdString = jobStatus.getJobId();
         Preconditions.checkNotNull(jobIdString, "The job to be suspend should 
not be null");
         var jobId = JobID.fromHexString(jobIdString);
         Optional<String> savepointOpt = Optional.empty();
+
+        if (ReconciliationUtils.isJobInTerminalState(sessionJobStatus)) {
+            LOG.info("Job is already in terminal state.");

Review Comment:
   I have validated the error through the minikube. Following are my 
observations.
   1. Suspending the job using Custom Resource is working fine. 
   2. If we cancel the job via flink cli, we are getting the error mentioned in 
the ticket. That is coming from the flink code. one example,
   
   - 
[Dispatcher.java#stopWithSavepointAndGetLocation](https://github.com/apache/flink/blob/5d66e82915eace9342c175163b17f610bfbf7fa4/flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java#L976)
   - 
[FlinkJobNotExceptionNotFound](https://github.com/apache/flink/blob/99c2a415e9eeefafacf70762b6f54070f7911ceb/flink-runtime/src/main/java/org/apache/flink/runtime/messages/FlinkJobNotFoundException.java#L29).
   
   Correct me If I am wrong, this is something we can't control via operator 
code right?. We need to modify the cli and flink session cluster code in flink.
   



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