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


##########
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:
   Please beware that what you wrote is based on the `TestingFlinkService` 
which is basically a mock that intents to emulate the Flink client behaviour. 
   
   The fact that you don't get certain errors that are explained the ticket 
does not mean that it works correctly only that the `TestingFlinkService` 
implementation is incorrect. It is best to test it manually in minikube to 
reproduce the problem, modify the testing service to represent the correct 
behaviour then write some tests and assert that you can reproduce the problem 
first.
   
   Then once you fix it you will know that it worked



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