Skip to content

Commit f7de68c

Browse files
committed
Improve code quality
1 parent d8b0248 commit f7de68c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,16 @@ private[kyuubi] class EngineRef(
239239
while (engineRef.isEmpty) {
240240
if (exitValue.isEmpty && process.waitFor(1, TimeUnit.SECONDS)) {
241241
exitValue = Some(process.exitValue())
242-
if (!exitValue.contains(0)) {
242+
if (exitValue.contains(0)) {
243+
acquiredPermit = false
244+
startupProcessSemaphore.foreach(_.release())
245+
} else {
243246
val error = builder.getError
244247
MetricsSystem.tracing { ms =>
245248
ms.incCount(MetricRegistry.name(ENGINE_FAIL, appUser))
246249
ms.incCount(MetricRegistry.name(ENGINE_FAIL, error.getClass.getSimpleName))
247250
}
248251
throw error
249-
} else {
250-
acquiredPermit = false
251-
startupProcessSemaphore.foreach(_.release())
252252
}
253253
}
254254

0 commit comments

Comments
 (0)