diff --git a/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkEngineConnExecutor.scala b/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkEngineConnExecutor.scala index d94dafa9f7..95c18b3ca9 100644 --- a/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkEngineConnExecutor.scala +++ b/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkEngineConnExecutor.scala @@ -315,9 +315,14 @@ abstract class SparkEngineConnExecutor(val sc: SparkContext, id: Long) logger.info(s"thread isInterrupted:${thread.isInterrupted}") if (closeThreadEnable) { - logger.info(s"try to force stop thread:${thread.getName}") - // force to stop scala thread - Utils.tryAndWarn(thread.stop()) + val threadName = thread.getName + if (threadName.contains("Linkis-Default-Scheduler-Thread-")) { + logger.info(s"try to force stop thread:${threadName}") + // force to stop scala thread + Utils.tryAndWarn(thread.stop()) + } else { + logger.info(s"skip to force stop thread:${threadName}") + } } } killRunningTask()