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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/sessionjob/SessionJobReconciler.java:
##########
@@ -100,6 +106,26 @@ public DeleteControl 
cleanupInternal(FlinkResourceContext<FlinkSessionJob> ctx)
             if (jobID != null) {
                 try {
                     cancelJob(ctx, UpgradeMode.STATELESS);
+                } catch (ExecutionException e) {
+                    final var cause = e.getCause();
+
+                    if (cause instanceof FlinkJobNotFoundException) {
+                        LOG.error("Job {} not found in the Flink cluster.", 
jobID, e);
+                        return DeleteControl.defaultDelete();
+                    }
+
+                    if (cause instanceof 
FlinkJobTerminatedWithoutCancellationException) {
+                        LOG.error("Job {} already terminated without 
cancellation.", jobID, e);
+                        return DeleteControl.defaultDelete();
+                    }
+
+                    final var delay = 10_000L;

Review Comment:
   We could also use the 
KubernetesOperatorConfigOptions.OPERATOR_OBSERVER_PROGRESS_CHECK_INTERVAL that 
we use for similar purposes. That also defaults to 10s



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