From c79bb47d923c69054de89aae82a83a1b2fd412ef Mon Sep 17 00:00:00 2001 From: ChengJie1053 <18033291053@163.com> Date: Thu, 14 Dec 2023 09:58:43 +0800 Subject: [PATCH] Fix flink sql kill yarn application and getJobStatus fail --- .../executor/service/TaskExecutionServiceImpl.scala | 4 ++-- .../flink/executor/FlinkSQLComputationExecutor.scala | 5 +++++ linkis-engineconn-plugins/repl/src/main/resources/log4j2.xml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/service/TaskExecutionServiceImpl.scala b/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/service/TaskExecutionServiceImpl.scala index 23d6ff2586..6b4fc64fe6 100644 --- a/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/service/TaskExecutionServiceImpl.scala +++ b/linkis-computation-governance/linkis-engineconn/linkis-computation-engineconn/src/main/scala/org/apache/linkis/engineconn/computation/executor/service/TaskExecutionServiceImpl.scala @@ -631,7 +631,7 @@ class TaskExecutionServiceImpl if (null != task) { sendToEntrance(task, ResponseTaskLog(logUpdateEvent.taskId, logUpdateEvent.log)) } else { - logger.error("Task cannot null! logupdateEvent: " + logUpdateEvent.taskId) + logger.warn("Task cannot null! logupdateEvent: " + logUpdateEvent.taskId) } } else if (null != lastTask) { val executor = executorManager.getReportExecutor @@ -733,7 +733,7 @@ class TaskExecutionServiceImpl if (null != executor) { executor.getTaskById(taskId) } else { - logger.error(s"Executor of taskId : $taskId is not cached.") + logger.warn(s"Executor of taskId : $taskId is not cached.") null } } diff --git a/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/executor/FlinkSQLComputationExecutor.scala b/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/executor/FlinkSQLComputationExecutor.scala index 2e3a2bd07a..60f1d9088b 100644 --- a/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/executor/FlinkSQLComputationExecutor.scala +++ b/linkis-engineconn-plugins/flink/flink-core/src/main/scala/org/apache/linkis/engineconnplugin/flink/executor/FlinkSQLComputationExecutor.scala @@ -236,6 +236,11 @@ class FlinkSQLComputationExecutor( super.close() } + override def tryShutdown(): Boolean = { + Utils.tryAndWarn(close()) + super.tryShutdown() + } + } class FlinkSQLStatusListener( diff --git a/linkis-engineconn-plugins/repl/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/repl/src/main/resources/log4j2.xml index 3e790b6dad..c75bf80fb3 100644 --- a/linkis-engineconn-plugins/repl/src/main/resources/log4j2.xml +++ b/linkis-engineconn-plugins/repl/src/main/resources/log4j2.xml @@ -47,7 +47,7 @@ - +