wangyang0918 commented on a change in pull request #26:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/26#discussion_r815602370
##########
File path:
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/JobReconciler.java
##########
@@ -179,4 +180,22 @@ private void printCancelLogs(UpgradeMode upgradeMode,
String name) {
savepointOpt.ifPresent(jobStatus::setSavepointLocation);
return savepointOpt;
}
+
+ @Override
+ protected void shutdown(FlinkDeployment flinkApp, Configuration
effectiveConfig) {
+ if (flinkApp.getStatus().getJobStatus() != null
+ && flinkApp.getStatus().getJobStatus().getJobId() != null) {
+ try {
+ flinkService.cancelJob(
+
JobID.fromHexString(flinkApp.getStatus().getJobStatus().getJobId()),
+ UpgradeMode.STATELESS,
+ effectiveConfig);
+ return;
+ } catch (Exception e) {
+ LOG.error("Could not shut down cluster gracefully,
deleting...", e);
+ }
+ }
+
+ FlinkUtils.deleteCluster(flinkApp, kubernetesClient, true);
Review comment:
My bad. I miss the return in the `try {...}`.
--
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]