Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Mar 31, 2023
1 parent 301162e commit 9ee7e04
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import io.fabric8.kubernetes.api.model.Pod
import io.fabric8.kubernetes.client.KubernetesClient
import io.fabric8.kubernetes.client.informers.{ResourceEventHandler, SharedIndexInformer}

import org.apache.kyuubi.Logging
import org.apache.kyuubi.{Logging, Utils}
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.engine.ApplicationState.{isTerminated, ApplicationState, FAILED, FINISHED, NOT_FOUND, PENDING, RUNNING, UNKNOWN}
import org.apache.kyuubi.engine.KubernetesApplicationOperation.{toApplicationState, LABEL_KYUUBI_UNIQUE_KEY, SPARK_APP_ID_LABEL}
Expand Down Expand Up @@ -136,18 +136,23 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging {
}

override def stop(): Unit = {
try {
Utils.tryLogNonFatalError {
if (enginePodInformer != null) {
enginePodInformer.stop()
enginePodInformer = null
}
}

Utils.tryLogNonFatalError {
if (kubernetesClient != null) {
kubernetesClient.close()
kubernetesClient = null
}
if (cleanupTerminatedAppInfoTrigger != null) {
cleanupTerminatedAppInfoTrigger.cleanUp()
}
} catch {
case e: Exception => error(e.getMessage)
}

if (cleanupTerminatedAppInfoTrigger != null) {
cleanupTerminatedAppInfoTrigger.cleanUp()
cleanupTerminatedAppInfoTrigger = null
}
}

Expand Down

0 comments on commit 9ee7e04

Please sign in to comment.