Skip to content

Commit 985e23c

Browse files
committed
Refine
1 parent f03d612 commit 985e23c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ApplicationOperation.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ object ApplicationState extends Enumeration {
9999

100100
def isFailed(
101101
state: ApplicationState,
102-
appOperation: Option[ApplicationOperation]): Boolean = state match {
102+
appOperation: Option[ApplicationOperation]): Boolean = {
103+
isFailed(state, appOperation.exists(_.supportPersistedAppState))
104+
}
105+
106+
def isFailed(state: ApplicationState, supportPersistedAppState: Boolean): Boolean = state match {
103107
case FAILED => true
104108
case KILLED => true
105-
case NOT_FOUND => appOperation.exists(_.supportPersistedAppState)
109+
case NOT_FOUND => supportPersistedAppState
106110
case _ => false
107111
}
108112

kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,7 @@ object KubernetesApplicationOperation extends Logging {
576576
case None => podAppState
577577
}
578578
val applicationError = {
579-
// here the applicationState could not been NOT_FOUND, safe to use None ApplicationOperation
580-
if (ApplicationState.isFailed(applicationState, appOperation = None)) {
579+
if (ApplicationState.isFailed(applicationState, supportPersistedAppState = true)) {
581580
val errorMap = containerStatusToBuildAppState.map { cs =>
582581
Map(
583582
"Pod" -> podName,

0 commit comments

Comments
 (0)