pan3793 commented on code in PR #5718:
URL: https://github.com/apache/kyuubi/pull/5718#discussion_r1396713514
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala:
##########
@@ -105,25 +105,31 @@ class KubernetesApplicationOperation extends
ApplicationOperation with Logging {
.expireAfterWrite(retainPeriod, TimeUnit.MILLISECONDS)
.removalListener((notification: RemovalNotification[String,
ApplicationState]) => {
Option(appInfoStore.remove(notification.getKey)).foreach { case
(kubernetesInfo, removed) =>
+ val appLabel = notification.getKey
if (deleteSparkDriverPodOnTermination) {
+ val podName = removed.name
try {
val kubernetesClient =
getOrCreateKubernetesClient(kubernetesInfo)
- if
(!kubernetesClient.pods().withName(removed.name).delete().isEmpty) {
- info(s"[$kubernetesInfo] Operation of delete pod
${removed.name} with" +
- s" ${toLabel(notification.getKey)} is completed.")
+ val deleted = if (podName == null) {
+ !kubernetesClient.pods()
+ .withLabel(LABEL_KYUUBI_UNIQUE_KEY, appLabel)
+ .delete().isEmpty
} else {
- warn(s"[$kubernetesInfo] Failed to delete pod ${removed.name}
with" +
- s" ${toLabel(notification.getKey)}.")
+ !kubernetesClient.pods().withName(podName).delete().isEmpty
+ }
+ if (deleted) {
+ info(s"[$kubernetesInfo] Operation of delete pod $podName
with" +
+ s" ${toLabel(appLabel)} is completed.")
+ } else {
+ warn(s"[$kubernetesInfo] Failed to delete pod $podName with
${toLabel(appLabel)}.")
Review Comment:
```suggestion
warn(s"[$kubernetesInfo] Failed to delete pod $podName with
${toLabel(appLabel)}.")
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]