diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala index f48cd0fcf4e..ba11dcb277e 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/operation/BatchJobSubmission.scala @@ -338,12 +338,6 @@ class BatchJobSubmission( override def close(): Unit = withLockRequired { if (!isClosedOrCanceled) { - try { - getOperationLog.foreach(_.close()) - } catch { - case e: IOException => error(e.getMessage, e) - } - MetricsSystem.tracing(_.decCount(MetricRegistry.name(OPERATION_OPEN, opType))) // fast fail @@ -379,6 +373,12 @@ class BatchJobSubmission( } } } + + try { + getOperationLog.foreach(_.close()) + } catch { + case e: IOException => error(e.getMessage, e) + } } override def cancel(): Unit = {