gyfora commented on code in PR #437:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/437#discussion_r1021154485
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconciler.java:
##########
@@ -318,6 +319,31 @@ private boolean shouldRestartJobBecauseUnhealthy(
return restartNeeded;
}
+ private boolean cleanupTerminalJmAfterTtl(
+ FlinkDeployment deployment, Configuration observeConfig) {
+ var status = deployment.getStatus();
+ boolean terminal = ReconciliationUtils.isJobInTerminalState(status);
+ boolean jmStillRunning =
+ status.getJobManagerDeploymentStatus() !=
JobManagerDeploymentStatus.MISSING;
+
+ if (terminal && jmStillRunning) {
+ var ttl =
observeConfig.get(KubernetesOperatorConfigOptions.OPERATOR_JM_SHUTDOWN_TTL);
+ boolean ttlPassed =
+ Instant.now()
+ .isAfter(
+ Instant.ofEpochMilli(
+ Long.parseLong(
+
status.getJobStatus().getUpdateTime()))
+ .plus(ttl));
+ if (ttlPassed) {
+ LOG.info("Removing JobManager deployment for terminal
application.");
+ flinkService.deleteClusterDeployment(deployment.getMetadata(),
status, false);
Review Comment:
Flink itself deletes HA metadata for terminal jobs, so this should not be
necessary
--
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]